export type DeleteApiApiAuthCustomRolesIdArgs = {sellerId: string | string, id: string | string}; export type DeleteApiApiAuthCustomRolesIdOptions = {baseUrl?: string | undefined, jwt?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a custom role * * DELETE /api/auth/custom-roles/{id} */ export const deleteApiApiAuthCustomRolesId = async (args: DeleteApiApiAuthCustomRolesIdArgs, options?: DeleteApiApiAuthCustomRolesIdOptions) => { const {baseUrl = "https://vivenu.com", fetch: fetchFn = fetch, jwt} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.sellerId != null) query.append("sellerId", String(args.sellerId)) if (jwt !== undefined) headers.set('authorization', `Bearer ${jwt}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/auth/custom-roles/${encodeURIComponent(String(args.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 };