export type GetApiRpcHasRoleOnOrganizationArgs = {organization_id: string, organization_role?: unknown | undefined}; export type GetApiRpcHasRoleOnOrganizationOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /rpc/has_role_on_organization */ export const getApiRpcHasRoleOnOrganization = async (args: GetApiRpcHasRoleOnOrganizationArgs, options?: GetApiRpcHasRoleOnOrganizationOptions) => { const {baseUrl = "https://vnaabuozknwgxuvnfwjo.supabase.co:443", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.organization_id != null) query.append("organization_id", String(args.organization_id)) if (args.organization_role != null) query.append("organization_role", String(args.organization_role)) const url = `${baseUrl.replace(/\/+$/, '')}/rpc/has_role_on_organization${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };