export type V1SubmitEmployeesDynamicDetailsRequest = {legalDetails?: {[key: string]: string} | undefined, customFields?: {[key: string]: string} | undefined}; export type PatchApiV1EmployeesEmployeeIdDynamicDetailsArgs = {employeeId: string, body: V1SubmitEmployeesDynamicDetailsRequest}; export type PatchApiV1EmployeesEmployeeIdDynamicDetailsOptions = {baseUrl?: string | undefined, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Submit dynamic data for employee creation * * PATCH /v1/employees/{employeeId}/dynamic-details */ export const patchApiV1EmployeesEmployeeIdDynamicDetails = async (args: PatchApiV1EmployeesEmployeeIdDynamicDetailsArgs, options?: PatchApiV1EmployeesEmployeeIdDynamicDetailsOptions) => { const {baseUrl = "https://api.usemultiplier.com", fetch: fetchFn = fetch, BearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (BearerAuth !== undefined) headers.set('authorization', `Bearer ${BearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/employees/${encodeURIComponent(String(args.employeeId))}/dynamic-details${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 };