export type DeleteApiAdExtraDaysAdExtraDayIdArgs = {token: unknown, adExtraDayId: number}; export type DeleteApiAdExtraDaysAdExtraDayIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Delete ad extra day * * DELETE /ad_extra_days/{adExtraDayId} */ export const deleteApiAdExtraDaysAdExtraDayId = async (args: DeleteApiAdExtraDaysAdExtraDayIdArgs, options: DeleteApiAdExtraDaysAdExtraDayIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.token != null) query.append("token", String(args.token)) const url = `${baseUrl.replace(/\/+$/, '')}/ad_extra_days/${encodeURIComponent(String(args.adExtraDayId))}${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 };