export type FileJoin = {tag?: (string | null) | undefined, title?: (string | null) | undefined, notes?: (string | null) | undefined, created_at?: string | undefined, file_updated_at?: string | undefined, id?: number | undefined, file: number | null, filename?: string | undefined, url?: string | undefined, full_url?: string | undefined, general_file_url?: string | undefined, blog_url?: string | undefined, large_blog_url?: string | undefined, large_thumbnail_url?: string | undefined, small_thumbnail_url?: string | undefined, filename_original?: string | undefined, file_type_t?: string | undefined, mime_content_type?: string | undefined, attr?: string | undefined, image_exif?: string | undefined}; export type DeleteApiWorksitesIdFilesArgs = {body: FileJoin}; export type DeleteApiWorksitesIdFilesOptions = {baseUrl?: string | undefined, Token?: string | undefined, fetch?: typeof fetch | undefined}; /** * Detach files * * DELETE /worksites/{id}/files */ export const deleteApiWorksitesIdFiles = async (args: DeleteApiWorksitesIdFilesArgs, options?: DeleteApiWorksitesIdFilesOptions) => { const {baseUrl = "https://crisiscleanup-3-api-production.up.railway.app", fetch: fetchFn = fetch, Token} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (Token !== undefined) headers.set("Authorization", Token) const url = `${baseUrl.replace(/\/+$/, '')}/worksites/${encodeURIComponent(String(args.id))}/files${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };