export type CreateApiV1GuestsPasswordResetTrueArgs = {body: {email_or_phone: string, first_name: string}}; export type CreateApiV1GuestsPasswordResetTrueOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Reset the password of a guest * * POST /v1/guests/password?reset=true */ export const createApiV1GuestsPasswordResetTrue = async (args: CreateApiV1GuestsPasswordResetTrueArgs, options?: CreateApiV1GuestsPasswordResetTrueOptions) => { const {baseUrl = "https://api.zenoti.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/v1/guests/password?reset=true${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return (await res.json()) as unknown };