feat(BOOK-54): Adjusted filter functionality to save filters as query parameters instead of paths
* feat(BOOK-54): Destination filters now matching on id instead of slug in preparation for filters from Contentstack Approved-by: Chuma Mcphoy (We Ahead)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import type { DestinationCityListItem } from "@scandic-hotels/trpc/types/destinationCityPage"
|
||||
import type {
|
||||
CategorizedHotelFilters,
|
||||
HotelFilter,
|
||||
HotelListingHotelData,
|
||||
HotelSortItem,
|
||||
HotelSortOption,
|
||||
@@ -8,9 +9,12 @@ import type {
|
||||
import type { ReadonlyURLSearchParams } from "next/navigation"
|
||||
|
||||
interface Actions {
|
||||
updateActiveFiltersAndSort: (filters: string[], sort: string | null) => void
|
||||
updateActiveFiltersAndSort: (
|
||||
filterSlugs: string[],
|
||||
sort: string | null
|
||||
) => void
|
||||
setPendingSort: (sort: HotelSortOption) => void
|
||||
togglePendingFilter: (filter: string) => void
|
||||
togglePendingFilter: (filter: HotelFilter) => void
|
||||
clearPendingFilters: () => void
|
||||
resetPendingValues: () => void
|
||||
setIsLoading: (isLoading: boolean) => void
|
||||
@@ -31,12 +35,12 @@ export interface DestinationDataState {
|
||||
pendingSort: HotelSortOption
|
||||
activeSort: HotelSortOption
|
||||
defaultSort: HotelSortOption
|
||||
pendingFilters: string[]
|
||||
activeFilters: string[]
|
||||
pendingFilters: HotelFilter[]
|
||||
activeFilters: HotelFilter[]
|
||||
filterFromUrl: HotelFilter | null
|
||||
pendingHotelCount: number
|
||||
pendingCityCount: number
|
||||
allFilters: CategorizedHotelFilters
|
||||
allFilterSlugs: string[]
|
||||
basePathnameWithoutFilters: string
|
||||
sortItems: HotelSortItem[]
|
||||
isLoading: boolean
|
||||
@@ -48,6 +52,5 @@ export interface InitialState
|
||||
"allHotels" | "allCities" | "sortItems" | "allFilters"
|
||||
> {
|
||||
pathname: string
|
||||
filterFromUrl?: string
|
||||
searchParams: ReadonlyURLSearchParams
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user