Skip to content

Commit

Permalink
site search should not adopt existing URL query string parameters (#2818
Browse files Browse the repository at this point in the history
)

src/app/search-navbar: do not merge existing query params

Do not merge existing query params when using site search from MyDSpace workflow.
  • Loading branch information
saschaszott authored Feb 22, 2024
1 parent 32bac12 commit d5aca76
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/app/search-navbar/search-navbar.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ describe('SearchNavbarComponent', () => {
fixture.detectChanges();
}));
it('to search page with empty query', () => {
const extras: NavigationExtras = { queryParams: { query: '' }, queryParamsHandling: 'merge' };
const extras: NavigationExtras = { queryParams: { query: '' } };
expect(component.onSubmit).toHaveBeenCalledWith({ query: '' });
expect(router.navigate).toHaveBeenCalledWith(['search'], extras);
});
Expand All @@ -113,7 +113,7 @@ describe('SearchNavbarComponent', () => {
fixture.detectChanges();
}));
it('to search page with query', async () => {
const extras: NavigationExtras = { queryParams: { query: 'test' }, queryParamsHandling: 'merge' };
const extras: NavigationExtras = { queryParams: { query: 'test' } };
expect(component.onSubmit).toHaveBeenCalledWith({ query: 'test' });

expect(router.navigate).toHaveBeenCalledWith(['search'], extras);
Expand Down
3 changes: 1 addition & 2 deletions src/app/search-navbar/search-navbar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ export class SearchNavbarComponent {
this.searchForm.reset();

this.router.navigate(linkToNavigateTo, {
queryParams: queryParams,
queryParamsHandling: 'merge'
queryParams: queryParams
});
}
}

0 comments on commit d5aca76

Please sign in to comment.