export type UpdateApiCandidatesWorkHistoryIdArgs = {id: number, body: {title: string, employer: {linked?: boolean | undefined, name?: string | undefined, location?: ({city?: string | undefined, state?: string | undefined}) | undefined}, supervisor?: ({linked?: boolean | undefined, name?: string | undefined, phone?: string | undefined}) | undefined, is_verified?: boolean | undefined, is_current?: string | undefined, start_date?: string | undefined, end_date?: string | undefined, reason_for_leaving?: string | undefined}}; export type UpdateApiCandidatesWorkHistoryIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update a candidate work history item * * PUT /candidates/work_history/{id} */ export const updateApiCandidatesWorkHistoryId = async (args: UpdateApiCandidatesWorkHistoryIdArgs, options?: UpdateApiCandidatesWorkHistoryIdOptions) => { const {baseUrl = "https://api.catsone.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/candidates/work_history/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", 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 };