Merge master
This commit is contained in:
@@ -100,14 +100,19 @@ export async function put(
|
||||
|
||||
export async function remove(
|
||||
endpoint: Endpoint | `${Endpoint}/${string}`,
|
||||
options: RequestOptionsWithOutBody,
|
||||
options: RequestOptionsWithJSONBody,
|
||||
params = {}
|
||||
) {
|
||||
const { body, ...requestOptions } = options
|
||||
const url = new URL(env.API_BASEURL)
|
||||
url.pathname = endpoint
|
||||
url.search = new URLSearchParams(params).toString()
|
||||
return wrappedFetch(
|
||||
url,
|
||||
merge.all([defaultOptions, { method: "DELETE" }, options])
|
||||
merge.all([
|
||||
defaultOptions,
|
||||
{ body: JSON.stringify(body), method: "DELETE" },
|
||||
requestOptions,
|
||||
])
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { getHotel as _getHotel } from "@/server/routers/hotels/utils"
|
||||
import { isDefined } from "@/server/utils"
|
||||
|
||||
import { getLang } from "@/i18n/serverContext"
|
||||
@@ -17,7 +18,6 @@ import type {
|
||||
HotelInput,
|
||||
} from "@/types/trpc/routers/hotel/hotel"
|
||||
import type { Lang } from "@/constants/languages"
|
||||
import type { LinkedReservationsInput } from "@/server/routers/booking/input"
|
||||
import type { GetHotelsByCSFilterInput } from "@/server/routers/hotels/input"
|
||||
import type { GetSavedPaymentCardsInput } from "@/server/routers/user/input"
|
||||
|
||||
@@ -136,8 +136,11 @@ export const getPackages = cache(async function getMemoizedPackages(
|
||||
})
|
||||
|
||||
export const getBookingConfirmation = cache(
|
||||
async function getMemoizedBookingConfirmation(confirmationNumber: string) {
|
||||
return serverClient().booking.get({ confirmationNumber })
|
||||
async function getMemoizedBookingConfirmation(refId: string, lang: Lang) {
|
||||
return serverClient().booking.confirmation({
|
||||
refId,
|
||||
lang,
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
@@ -156,8 +159,11 @@ export const findBooking = cache(async function getMemoizedFindBooking(
|
||||
})
|
||||
|
||||
export const getLinkedReservations = cache(
|
||||
async function getMemoizedLinkedReservations(input: LinkedReservationsInput) {
|
||||
return serverClient().booking.linkedReservations(input)
|
||||
async function getMemoizedLinkedReservations(refId: string, lang: Lang) {
|
||||
return serverClient().booking.linkedReservations({
|
||||
refId,
|
||||
lang,
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user