export type ExpensePolicyUnassignment = {assignee_ids: Array}; export type DeleteApiBusinessV2ExpensePoliciesAssigneesArgs = {body: ExpensePolicyUnassignment}; export type DeleteApiBusinessV2ExpensePoliciesAssigneesOptions = {baseUrl?: string | undefined, standardAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Unassign any Expense Policy from Users * * DELETE /business/v2/expense-policies/assignees */ export const deleteApiBusinessV2ExpensePoliciesAssignees = async (args: DeleteApiBusinessV2ExpensePoliciesAssigneesArgs, options?: DeleteApiBusinessV2ExpensePoliciesAssigneesOptions) => { const {baseUrl = "https://api.soldo.com", fetch: fetchFn = fetch, standardAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (standardAuth !== undefined) headers.set('authorization', `Bearer ${standardAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/business/v2/expense-policies/assignees${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", 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 };