export type DeleteApiPiasPiaIdMeasuresIdArgs = {pia_id: number, id: number}; export type DeleteApiPiasPiaIdMeasuresIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * deletes a single measure based on the ID supplied * * DELETE /pias/{pia_id}/measures/{id} */ export const deleteApiPiasPiaIdMeasuresId = async (args: DeleteApiPiasPiaIdMeasuresIdArgs, options?: DeleteApiPiasPiaIdMeasuresIdOptions) => { const {baseUrl = "https://pia-back.atnosapp.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/pias/${encodeURIComponent(String(args.pia_id))}/measures/${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 };