export type DateISO = string; export type ReplaceCandidateEducationDto = {companyId: string, degree: 'High School' | 'Certificate' | 'Diploma' | 'Associate' | 'Professional' | 'Vocational' | 'Bachelor' | 'Master' | 'Postgraduate Diploma' | 'MBA' | 'LLM' | 'PhD' | 'Postdoctoral' | null, fieldOfStudy: string | null, grade: string | null, description: string | null, startDate: DateISO | null, endDate: DateISO | null, id: string} | {companyId: string, degree: 'High School' | 'Certificate' | 'Diploma' | 'Associate' | 'Professional' | 'Vocational' | 'Bachelor' | 'Master' | 'Postgraduate Diploma' | 'MBA' | 'LLM' | 'PhD' | 'Postdoctoral' | null, fieldOfStudy: string | null, grade: string | null, description: string | null, startDate: DateISO | null, endDate: DateISO | null}; export type ReplaceCandidateEducationListDto = {items: Array}; export type UpdateApiCandidatesIdEducationArgs = {id: string, body: ReplaceCandidateEducationListDto}; export type UpdateApiCandidatesIdEducationOptions = {baseUrl: string, xApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Replace education * * PUT /candidates/{id}/education */ export const updateApiCandidatesIdEducation = async (args: UpdateApiCandidatesIdEducationArgs, options: UpdateApiCandidatesIdEducationOptions) => { const {baseUrl, fetch: fetchFn = fetch, xApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (xApiKey !== undefined) headers.set("x-api-key", xApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/candidates/${encodeURIComponent(String(args.id))}/education${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 };