Skip to content

Commit 42c8b70

Browse files
alisaismailatiFrancescoMolinaro
authored andcommitted
Merged in DSC-1668 (pull request DSpace#1641)
[DSC-1668] fix when page changes on search-chart-filter Approved-by: Francesco Molinaro
2 parents a214e89 + c341b38 commit 42c8b70

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)