Fix for ACA upstream (#11642)

This commit is contained in:
Dominik Iwanek
2026-02-11 18:46:57 +01:00
committed by GitHub
parent 823a147656
commit 1fa683e2a9
2 changed files with 7 additions and 6 deletions

View File

@@ -341,13 +341,13 @@ describe('BaseQueryBuilderService', () => {
);
});
it('should update URL params even when query is null', async () => {
it('should not update URL params even when query is null', async () => {
spyOn(router, 'navigate').and.returnValue(Promise.resolve(true));
service.userQuery = '';
await service.execute();
expect(router.navigate).toHaveBeenCalled();
expect(router.navigate).not.toHaveBeenCalled();
});
});
@@ -446,11 +446,12 @@ describe('BaseQueryBuilderService', () => {
it('should call execute when updating configuration', async () => {
spyOn(router, 'navigate').and.returnValue(Promise.resolve(true));
spyOn(service.searchApi, 'search').and.returnValue(Promise.resolve({ list: { entries: [] } } as ResultSetPaging));
spyOn(service, 'execute')
service.userQuery = 'test';
service.updateSelectedConfiguration('config-2');
expect(router.navigate).toHaveBeenCalled();
expect(service.execute).toHaveBeenCalled();
});
});

View File

@@ -374,11 +374,11 @@ export abstract class BaseQueryBuilderService {
*/
async execute(updateQueryParams = true, queryBody?: SearchRequest) {
try {
if (updateQueryParams) {
this.updateSearchQueryParams();
}
const query = queryBody ? queryBody : this.buildQuery();
if (query) {
if (updateQueryParams) {
this.updateSearchQueryParams();
}
const resultSetPaging: ResultSetPaging = await this.searchApi.search(query);
this.executed.next(resultSetPaging);
}