mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-31 09:37:15 +01:00
[HIMA-67] - search filters included
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { FilterState } from './../../core/store/state/filter.state';
|
||||
import { ProductService } from './../../core/services/product.service';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Search } from 'src/app/core/models/search.model';
|
||||
@@ -53,10 +54,20 @@ export class SearchResultsComponent implements OnInit {
|
||||
this.ds = new SearchDataSource(
|
||||
this.productService,
|
||||
this.currentSearch.query,
|
||||
this.store
|
||||
this.store,
|
||||
[]
|
||||
);
|
||||
// this.store.dispatch(new GetProducts(this.currentSearch));
|
||||
// this.loadProducts();
|
||||
|
||||
this.store.select(FilterState.getFilters).subscribe(fil => {
|
||||
if (!!fil) {
|
||||
this.ds = new SearchDataSource(
|
||||
this.productService,
|
||||
this.currentSearch.query,
|
||||
this.store,
|
||||
fil
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
loadCurrentSearch() {
|
||||
@@ -104,7 +115,8 @@ export class SearchDataSource extends DataSource<Product | undefined> {
|
||||
constructor(
|
||||
private searchService: ProductService,
|
||||
private search: string,
|
||||
private store: Store
|
||||
private store: Store,
|
||||
private filters: any[]
|
||||
) {
|
||||
super();
|
||||
}
|
||||
@@ -148,7 +160,7 @@ export class SearchDataSource extends DataSource<Product | undefined> {
|
||||
this.search,
|
||||
page * this.pageSize,
|
||||
this.pageSize,
|
||||
[]
|
||||
this.filters
|
||||
)
|
||||
.pipe(take(1))
|
||||
.subscribe(data => {
|
||||
|
||||
Reference in New Issue
Block a user