export type Timestamp = {date?: number | undefined, day?: number | undefined, hours?: number | undefined, minutes?: number | undefined, month?: number | undefined, nanos?: number | undefined, seconds?: number | undefined, time?: number | undefined, timezoneOffset?: number | undefined, year?: number | undefined}; export type TipoEmpleado = {created_at?: Timestamp | undefined, descripcion?: string | undefined, empleado_id?: number | undefined, horarios?: string | undefined, id?: number | undefined, tipo?: string | undefined, update_at?: Timestamp | undefined}; export type UpdateApiApiUpdateTipoEmpleadoIdArgs = {id: number, body: TipoEmpleado}; export type UpdateApiApiUpdateTipoEmpleadoIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * actualizar tipo de empleado en la bd * * PUT /api/updateTipoEmpleado/{id} */ export const updateApiApiUpdateTipoEmpleadoId = async (args: UpdateApiApiUpdateTipoEmpleadoIdArgs, options: UpdateApiApiUpdateTipoEmpleadoIdOptions) => { 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/updateTipoEmpleado/${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 res.blob() };