export type OrganizationMember = {created_at: unknown, user_id: string, organization_id: string, email?: unknown | undefined, organization_role: 'owner' | 'member'}; export type PatchApiOrganizationMemberArgs = {created_at?: unknown | undefined, user_id?: string | undefined, organization_id?: string | undefined, email?: unknown | undefined, organization_role?: unknown | undefined, Prefer?: ('return=representation' | 'return=minimal' | 'return=none') | undefined, body: OrganizationMember}; export type PatchApiOrganizationMemberOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * PATCH /organization_member */ export const patchApiOrganizationMember = async (args: PatchApiOrganizationMemberArgs, options?: PatchApiOrganizationMemberOptions) => { 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.created_at != null) query.append("created_at", String(args.created_at)) if (args.user_id != null) query.append("user_id", String(args.user_id)) if (args.organization_id != null) query.append("organization_id", String(args.organization_id)) if (args.email != null) query.append("email", String(args.email)) if (args.organization_role != null) query.append("organization_role", String(args.organization_role)) if (args.Prefer != null) headers.set("Prefer", String(args.Prefer)) const url = `${baseUrl.replace(/\/+$/, '')}/organization_member${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 };