export type AltaEmpleadosDeObra = {apellidoMaterno?: string | undefined, apellidoPaterno?: string | undefined, estatus?: string | undefined, fecha?: string | undefined, foto?: string | undefined, idAreaTrabajo?: number | undefined, idEmpleadoObra?: number | undefined, idPatron?: number | undefined, nombre?: string | undefined, observaciones?: string | undefined, tipoAcceso?: string | undefined, tipoServicio?: number | undefined}; export type CreateApiApiObtenerEmpleadoArgs = {body: AltaEmpleadosDeObra}; export type CreateApiApiObtenerEmpleadoOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Obtiene empleados * * POST /api/obtenerEmpleado */ export const createApiApiObtenerEmpleado = async (args: CreateApiApiObtenerEmpleadoArgs, options: CreateApiApiObtenerEmpleadoOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") const url = `${baseUrl.replace(/\/+$/, '')}/api/obtenerEmpleado${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 res.blob() };