export type UpdateApiJobsIdArgs = {id: number, body: {title: string, location: {city?: string | undefined, state?: string | undefined, postal_code?: string | undefined}, country_code?: string | undefined, company_id: number, department_id?: number | undefined, recruiter_id?: number | undefined, owner_id?: number | undefined, category_name?: string | undefined, is_hot?: boolean | undefined, start_date?: string | undefined, salary?: string | undefined, max_rate?: string | undefined, duration?: string | undefined, type?: string | undefined, openings?: number | undefined, external_id?: string | undefined, description?: string | undefined, notes?: string | undefined, contact_id?: number | undefined, custom_fields?: Array | undefined, user_groups?: Array | undefined}}; export type UpdateApiJobsIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update a job * * PUT /jobs/{id} */ export const updateApiJobsId = async (args: UpdateApiJobsIdArgs, options?: UpdateApiJobsIdOptions) => { 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(/\/+$/, '')}/jobs/${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 };