export type CreateApiResumesIdLockArgs = {id: string, body: {isLocked: boolean}}; export type CreateApiResumesIdLockOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Set resume lock status * * POST /resumes/{id}/lock */ export const createApiResumesIdLock = async (args: CreateApiResumesIdLockArgs, options?: CreateApiResumesIdLockOptions) => { const {baseUrl = "http://localhost:3000/api/openapi", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (apiKey !== undefined) headers.set("x-api-key", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/resumes/${encodeURIComponent(String(args.id))}/lock${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", 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 };