Skip to content

Commit 761a797

Browse files
alisaismailatisteph-ieffam
authored andcommitted
Merged in DSC-1546 (pull request DSpace#1456)
[DSC-1546] do not add the same selected value in queryParams (in chart-filter) Approved-by: Stefano Maffei
2 parents ec0de59 + b4d1558 commit 761a797

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ export class SearchChartFilterComponent extends SearchFacetFilterComponent imple
8383
const queryParam: any = {};
8484
links[1].split('&').forEach(res => {
8585
const str = res.split('=');
86+
if (queryParam[str[0]] && queryParam[str[0]].includes(str[1])) {
87+
// if the value is already selected, then return
88+
// do not add the same value again
89+
return;
90+
}
8691
queryParam[str[0]] = queryParam[str[0]] ? [...queryParam[str[0]], str[1]] : [str[1]];
8792
});
8893
this.router.navigate(this.getSearchLinkParts(), {

0 commit comments

Comments
 (0)