export type DeleteApiDescriptionDescriptionIdArgs = {descriptionId: number}; export type DeleteApiDescriptionDescriptionIdOptions = {baseUrl?: string | undefined, sessionAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Deletes a single description based on the ID supplied * * DELETE /description/{descriptionId} */ export const deleteApiDescriptionDescriptionId = async (args: DeleteApiDescriptionDescriptionIdArgs, options?: DeleteApiDescriptionDescriptionIdOptions) => { const {baseUrl = "https://small-eod.siecobywatelska.pl/v1", fetch: fetchFn = fetch, sessionAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (sessionAuth !== undefined) cookies.push("session=" + encodeURIComponent(sessionAuth)) const url = `${baseUrl.replace(/\/+$/, '')}/description/${encodeURIComponent(String(args.descriptionId))}${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 };