Merge branch 'develop' into feat/SW-266-seo-loyalty-pages
This commit is contained in:
@@ -8,10 +8,11 @@ export namespace endpoints {
|
||||
export const enum v1 {
|
||||
profile = "profile/v1/Profile",
|
||||
creditCards = `${profile}/creditCards`,
|
||||
initiateSaveCard = `${creditCards}/initiateSaveCard`,
|
||||
friendTransactions = "profile/v1/Transaction/friendTransactions",
|
||||
upcomingStays = "booking/v1/Stays/future",
|
||||
previousStays = "booking/v1/Stays/past",
|
||||
hotel = "hotel/v1/Hotels",
|
||||
hotels = "hotel/v1/Hotels",
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import type {
|
||||
RequestOptionsWithJSONBody,
|
||||
RequestOptionsWithOutBody,
|
||||
} from "@/types/fetch"
|
||||
import type { Endpoint } from "./endpoints"
|
||||
import type { Endpoint, endpoints } from "./endpoints"
|
||||
|
||||
export { endpoints } from "./endpoints"
|
||||
|
||||
@@ -27,7 +27,7 @@ const fetch = fetchRetry(global.fetch, {
|
||||
})
|
||||
|
||||
export async function get(
|
||||
endpoint: Endpoint,
|
||||
endpoint: Endpoint | `${endpoints.v1.hotels}/${string}`,
|
||||
options: RequestOptionsWithOutBody,
|
||||
params?: URLSearchParams
|
||||
) {
|
||||
@@ -53,7 +53,7 @@ export async function patch(
|
||||
}
|
||||
|
||||
export async function post(
|
||||
endpoint: Endpoint,
|
||||
endpoint: Endpoint | `${Endpoint}/${string}`,
|
||||
options: RequestOptionsWithJSONBody
|
||||
) {
|
||||
const { body, ...requestOptions } = options
|
||||
|
||||
Reference in New Issue
Block a user