export type DeleteApiDictionaryDictionaryIdArgs = {dictionaryId: number}; export type DeleteApiDictionaryDictionaryIdOptions = {baseUrl?: string | undefined, sessionAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Deletes a single dictionary based on the ID supplied * * DELETE /dictionary/{dictionaryId} */ export const deleteApiDictionaryDictionaryId = async (args: DeleteApiDictionaryDictionaryIdArgs, options?: DeleteApiDictionaryDictionaryIdOptions) => { 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(/\/+$/, '')}/dictionary/${encodeURIComponent(String(args.dictionaryId))}${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 };