export type DeleteApiBusinessV2ExpenseReportsExpenseReportIdArgs = {expenseReportId: string}; export type DeleteApiBusinessV2ExpenseReportsExpenseReportIdOptions = {baseUrl?: string | undefined, standardAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Expense Report * * DELETE /business/v2/expense-reports/{expenseReportId} */ export const deleteApiBusinessV2ExpenseReportsExpenseReportId = async (args: DeleteApiBusinessV2ExpenseReportsExpenseReportIdArgs, options?: DeleteApiBusinessV2ExpenseReportsExpenseReportIdOptions) => { const {baseUrl = "https://api.soldo.com", fetch: fetchFn = fetch, standardAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (standardAuth !== undefined) headers.set('authorization', `Bearer ${standardAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/business/v2/expense-reports/${encodeURIComponent(String(args.expenseReportId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };