mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-31 09:37:15 +01:00
#3773 Filter Zielfiliale
This commit is contained in:
@@ -162,15 +162,11 @@ export class CustomerOrderSearchStore extends ComponentStore<CustomerOrderSearch
|
||||
switchMap(([options, results, filter, branch]) => {
|
||||
const queryToken = filter?.getQueryToken() ?? {};
|
||||
|
||||
let cachedResultCount: number;
|
||||
|
||||
const cached = options?.siletReload && this._cache.get(filter?.getQueryToken());
|
||||
if (cached) {
|
||||
const cachedResults = this._cache.get(queryToken);
|
||||
if (cachedResults?.results?.length > 0) {
|
||||
this.patchState(cachedResults);
|
||||
cachedResultCount = cachedResults.results.length;
|
||||
|
||||
this._searchResultFromCacheSubject.next({ hits: cachedResults.hits, results: cachedResults.results });
|
||||
}
|
||||
}
|
||||
@@ -180,7 +176,7 @@ export class CustomerOrderSearchStore extends ComponentStore<CustomerOrderSearch
|
||||
queryToken.take = 50;
|
||||
} else if (options.siletReload) {
|
||||
queryToken.skip = 0;
|
||||
queryToken.take = cachedResultCount || results.length || 50;
|
||||
queryToken.take = 50;
|
||||
} else {
|
||||
queryToken.skip = results.length;
|
||||
queryToken.take = 50;
|
||||
|
||||
Reference in New Issue
Block a user