diff --git a/apps/scandic-web/components/Forms/BookingWidget/FormContent/Search/reducer.ts b/apps/scandic-web/components/Forms/BookingWidget/FormContent/Search/reducer.ts index 3ca0e2b93..42c9b2110 100644 --- a/apps/scandic-web/components/Forms/BookingWidget/FormContent/Search/reducer.ts +++ b/apps/scandic-web/components/Forms/BookingWidget/FormContent/Search/reducer.ts @@ -4,7 +4,7 @@ import { type InitState, type State, } from "@/types/components/form/bookingwidget" -import type { Locations } from "@/types/trpc/routers/hotel/locations" +import type { Location } from "@/types/trpc/routers/hotel/locations" export const localStorageKey = "searchHistory" export const sessionStorageKey = "searchData" @@ -61,7 +61,7 @@ export function reducer(state: State, action: Action) { } }) - const matches: Locations = [] + const matches: Location[] = [] matchesMap.forEach((value) => { matches.push(value) }) diff --git a/apps/scandic-web/types/components/form/bookingwidget.ts b/apps/scandic-web/types/components/form/bookingwidget.ts index 3902115a0..87c93b5a7 100644 --- a/apps/scandic-web/types/components/form/bookingwidget.ts +++ b/apps/scandic-web/types/components/form/bookingwidget.ts @@ -1,14 +1,14 @@ import type { BookingWidgetType } from "@/types/components/bookingWidget" -import type { Location, Locations } from "@/types/trpc/routers/hotel/locations" +import type { Location } from "@/types/trpc/routers/hotel/locations" export interface BookingWidgetFormProps { - locations: Locations + locations: Location[] type?: BookingWidgetType onClose: () => void } export interface BookingWidgetFormContentProps { - locations: Locations + locations: Location[] formId: string onSubmit: () => void isSearching: boolean @@ -40,7 +40,7 @@ interface SearchLocationsAction { interface SetItemAction { payload: { location: Location - searchHistory: Locations + searchHistory: Location[] } type: ActionType.SELECT_ITEM } @@ -48,7 +48,7 @@ interface SetItemAction { export interface SetStorageData { payload: { searchData?: Location - searchHistory?: Locations + searchHistory?: Location[] } type: ActionType.SET_STORAGE_DATA } @@ -61,11 +61,11 @@ export type Action = | SetStorageData export interface State { - defaultLocations: Locations - locations: Locations + defaultLocations: Location[] + locations: Location[] search: string searchData: Location | undefined - searchHistory: Locations | null + searchHistory: Location[] | null } export interface InitState extends Pick { diff --git a/apps/scandic-web/types/components/search.ts b/apps/scandic-web/types/components/search.ts index 0c4513711..0574b8514 100644 --- a/apps/scandic-web/types/components/search.ts +++ b/apps/scandic-web/types/components/search.ts @@ -2,10 +2,10 @@ import type { VariantProps } from "class-variance-authority" import type { PropGetters } from "downshift" import type { dialogVariants } from "@/components/Forms/BookingWidget/FormContent/Search/SearchList/Dialog/variants" -import type { Location, Locations } from "../trpc/routers/hotel/locations" +import type { Location } from "../trpc/routers/hotel/locations" export interface SearchProps { - locations: Locations + locations: Location[] handlePressEnter: () => void } @@ -22,9 +22,9 @@ export interface SearchListProps { isOpen: boolean handleClearSearchHistory: () => void highlightedIndex: HighlightedIndex - locations: Locations + locations: Location[] search: string - searchHistory: Locations | null + searchHistory: Location[] | null } export interface ListProps diff --git a/apps/scandic-web/types/trpc/routers/hotel/locations.ts b/apps/scandic-web/types/trpc/routers/hotel/locations.ts index f679751eb..c8bb2c151 100644 --- a/apps/scandic-web/types/trpc/routers/hotel/locations.ts +++ b/apps/scandic-web/types/trpc/routers/hotel/locations.ts @@ -8,8 +8,7 @@ import type { export interface LocationSchema extends z.output {} -export type Locations = LocationSchema["data"] -export type Location = Locations[number] +export type Location = LocationSchema["data"][number] export type CityLocation = Location & { type: "cities" } export type HotelLocation = Location & { type: "hotels" }