export type UpdateEmployeeDto = {email?: string | undefined, firstName?: string | undefined, lastName?: string | undefined, password?: string | undefined, role?: ('employee' | 'admin') | undefined, zendeskAgentEmail?: (string | null) | undefined, isActive?: boolean | undefined}; export type PatchApiEmployeesIdArgs = {id: number, body: UpdateEmployeeDto}; export type PatchApiEmployeesIdOptions = {baseUrl?: string | undefined, accessToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update an employee * * PATCH /employees/{id} */ export const patchApiEmployeesId = async (args: PatchApiEmployeesIdArgs, options?: PatchApiEmployeesIdOptions) => { const {baseUrl = "https://api.findmydocument.net", fetch: fetchFn = fetch, accessToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (accessToken !== undefined) headers.set('authorization', `Bearer ${accessToken}`) const url = `${baseUrl.replace(/\/+$/, '')}/employees/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", 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 };