feat: enhance stays with api data
This commit is contained in:
+6
-2
@@ -20,10 +20,14 @@ const defaultOptions: RequestInit = {
|
||||
|
||||
export async function get(
|
||||
endpoint: Endpoint,
|
||||
options: RequestOptionsWithOutBody
|
||||
options: RequestOptionsWithOutBody,
|
||||
params?: URLSearchParams
|
||||
) {
|
||||
defaultOptions.method = "GET"
|
||||
return fetch(`${env.API_BASEURL}/${endpoint}`, merge(defaultOptions, options))
|
||||
const url = new URL(
|
||||
`${env.API_BASEURL}/${endpoint}${params ? `?${params.toString()}` : ""}`
|
||||
)
|
||||
return fetch(url, merge(defaultOptions, options))
|
||||
}
|
||||
|
||||
export async function patch(
|
||||
|
||||
Reference in New Issue
Block a user