Skip to content

Commit

Permalink
FIX FIX FIX
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaeloxMC committed Aug 2, 2024
1 parent 897fdd7 commit f348cd9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/app/components/filter/filter.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,15 @@ export class FilterComponent implements OnInit {
acceptFilters() {
this.filtersEvent.emit(this.filters);
const filterNames = this.filters.map(filter => filter.name).join(',');
const url = `${window.location.href.split("&filters=")[0]}&filters=${encodeURIComponent(filterNames)}`;
window.location.href = url;
const encodedFilters = encodeURIComponent(filterNames);
const currentUrl = window.location.href;

if (currentUrl.includes("/search-result")) {
const url = `${currentUrl.split("&filters=")[0]}&filters=${encodedFilters}`;
window.location.href = url;
} else {
const url = `/search-result?filters=${encodedFilters}`;
window.location.href = url;
}
}
}

0 comments on commit f348cd9

Please sign in to comment.