export type TicketQuestions = {ticket_id: string, question_id: string, id: string}; export type PatchApiTicketQuestionsArgs = {ticket_id?: string | undefined, question_id?: string | undefined, id?: string | undefined, Prefer?: ('return=representation' | 'return=minimal' | 'return=none') | undefined, body: TicketQuestions}; export type PatchApiTicketQuestionsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * PATCH /ticket_questions */ export const patchApiTicketQuestions = async (args: PatchApiTicketQuestionsArgs, options?: PatchApiTicketQuestionsOptions) => { const {baseUrl = "https://vnaabuozknwgxuvnfwjo.supabase.co:443", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args.ticket_id != null) query.append("ticket_id", String(args.ticket_id)) if (args.question_id != null) query.append("question_id", String(args.question_id)) if (args.id != null) query.append("id", String(args.id)) if (args.Prefer != null) headers.set("Prefer", String(args.Prefer)) const url = `${baseUrl.replace(/\/+$/, '')}/ticket_questions${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", 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 undefined };