feat: update getHotel to use real hotel api endpoint, support for service tokens, type modifications
This commit is contained in:
@@ -12,8 +12,14 @@ export namespace endpoints {
|
||||
friendTransactions = "profile/v1/Transaction/friendTransactions",
|
||||
upcomingStays = "booking/v1/Stays/future",
|
||||
previousStays = "booking/v1/Stays/past",
|
||||
hotel = "hotel/v1/Hotels",
|
||||
hotels = "hotel/v1/Hotels",
|
||||
}
|
||||
}
|
||||
|
||||
export type Endpoint = endpoints.v0 | endpoints.v1
|
||||
export const getHotelEndpoint = (hotelId: string | number) =>
|
||||
`${endpoints.v1.hotels}/${hotelId}` as const
|
||||
|
||||
export type Endpoint =
|
||||
| endpoints.v0
|
||||
| endpoints.v1
|
||||
| ReturnType<typeof getHotelEndpoint>
|
||||
|
||||
@@ -9,7 +9,7 @@ import type {
|
||||
} from "@/types/fetch"
|
||||
import type { Endpoint } from "./endpoints"
|
||||
|
||||
export { endpoints } from "./endpoints"
|
||||
export { endpoints, getHotelEndpoint } from "./endpoints"
|
||||
|
||||
const defaultOptions: RequestInit = {
|
||||
cache: "no-store",
|
||||
|
||||
Reference in New Issue
Block a user