export type DeleteApiApiV1AdminSuppliersSupplierIdArgs = {supplier_id: string}; export type DeleteApiApiV1AdminSuppliersSupplierIdOptions = {baseUrl: string, OAuth2PasswordBearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Soft Delete Supplier * * DELETE /api/v1/admin/suppliers/{supplier_id} */ export const deleteApiApiV1AdminSuppliersSupplierId = async (args: DeleteApiApiV1AdminSuppliersSupplierIdArgs, options: DeleteApiApiV1AdminSuppliersSupplierIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, OAuth2PasswordBearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (OAuth2PasswordBearer !== undefined) headers.set('authorization', `Bearer ${OAuth2PasswordBearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/admin/suppliers/${encodeURIComponent(String(args.supplier_id))}${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 };