export type DeleteApiCandidatesWorkExperiencesWorkExperienceIdArgs = {workExperienceId: string}; export type DeleteApiCandidatesWorkExperiencesWorkExperienceIdOptions = {baseUrl: string, xApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete work experience * * DELETE /candidates/work-experiences/{workExperienceId} */ export const deleteApiCandidatesWorkExperiencesWorkExperienceId = async (args: DeleteApiCandidatesWorkExperiencesWorkExperienceIdArgs, options: DeleteApiCandidatesWorkExperiencesWorkExperienceIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, xApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (xApiKey !== undefined) headers.set("x-api-key", xApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/candidates/work-experiences/${encodeURIComponent(String(args.workExperienceId))}${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 };