Skip to content

Commit

Permalink
fix element removal
Browse files Browse the repository at this point in the history
  • Loading branch information
boal committed Nov 17, 2023
1 parent f030ae1 commit 2a1983b
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions frontend/src/store/modules/SearchStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,16 @@ export default {
},
removeSearchResultById(state: SearchState, id: string): void {
const searchResults = _.cloneDeep(state.searchResults);
searchResults.searchResults = _.toArray(state.searchResults.searchResults).filter(
(searchResult: SearchResultDto) => {
return !(
(_.isEqual(searchResult.type, SearchResultDtoTypeEnum.Abfrage) &&
_.isEqual(id, (searchResult as AbfrageSearchResultDto).id)) ||
(_.isEqual(searchResult.type, SearchResultDtoTypeEnum.Bauvorhaben) &&
_.isEqual(id, (searchResult as BauvorhabenSearchResultDto).id)) ||
(_.isEqual(searchResult.type, SearchResultDtoTypeEnum.Infrastruktureinrichtung) &&
_.isEqual(id, (searchResult as BauvorhabenSearchResultDto).id))
);
},
);
searchResults.searchResults = _.toArray(searchResults.searchResults).filter((searchResult: SearchResultDto) => {
return !(
(_.isEqual(searchResult.type, SearchResultDtoTypeEnum.Abfrage) &&
_.isEqual(id, (searchResult as AbfrageSearchResultDto).id)) ||
(_.isEqual(searchResult.type, SearchResultDtoTypeEnum.Bauvorhaben) &&
_.isEqual(id, (searchResult as BauvorhabenSearchResultDto).id)) ||
(_.isEqual(searchResult.type, SearchResultDtoTypeEnum.Infrastruktureinrichtung) &&
_.isEqual(id, (searchResult as BauvorhabenSearchResultDto).id))
);
});
state.searchResults = searchResults;
},
requestSearchQueryAndSorting(state: SearchState, searchQueryAndSortingDto: SearchQueryAndSortingModel): void {
Expand Down

0 comments on commit 2a1983b

Please sign in to comment.