export type DeleteApiV10LogTypeLogTypeIdArgs = {logTypeId: number, Authorization: string, 'Content-Type': string}; export type DeleteApiV10LogTypeLogTypeIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a manual log entry * * DELETE /v1.0/logType/{logTypeId} */ export const deleteApiV10LogTypeLogTypeId = async (args: DeleteApiV10LogTypeLogTypeIdArgs, options?: DeleteApiV10LogTypeLogTypeIdOptions) => { const {baseUrl = "https://api.lofty.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.Authorization != null) headers.set("Authorization", String(args.Authorization)) if (args['Content-Type'] != null) headers.set("Content-Type", String(args['Content-Type'])) const url = `${baseUrl.replace(/\/+$/, '')}/v1.0/logType/${encodeURIComponent(String(args.logTypeId))}${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 };