Skip to content

Commit c341b38

Browse files
[DSC-1668] fix when page changes on search-chart-filter
1 parent d2b6c3e commit c341b38

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/app/shared/search/search-charts/search-chart/search-chart-filter/search-chart-filter.component.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,18 @@ export class SearchChartFilterComponent extends SearchFacetFilterComponent imple
9090
}
9191
queryParam[str[0]] = queryParam[str[0]] ? [...queryParam[str[0]], str[1]] : [str[1]];
9292
});
93+
94+
if (this.currentUrl) {
95+
const currentQueryParams = this.currentUrl.split('?')[1].split('&');
96+
const pageParam = currentQueryParams.filter((param) => param.includes('page'));
97+
if (pageParam.length > 0) {
98+
const paramName = pageParam[0].split('=')[0];
99+
queryParam[paramName] = [1];
100+
}
101+
} else {
102+
queryParam['spc.page'] = [1];
103+
}
104+
93105
this.router.navigate(this.getSearchLinkParts(), {
94106
queryParams: queryParam,
95107
queryParamsHandling: 'merge',

0 commit comments

Comments
 (0)