export type AltaPatronesResponsablesRequest = {apellidoMaterno?: string | undefined, apellidoPaterno?: string | undefined, empresa?: string | undefined, estatus?: string | undefined, foto?: string | undefined, idAreaTrabajo?: number | undefined, idPatron?: number | undefined, nombre?: string | undefined, tipoServicio?: number | undefined}; export type CreateApiApiNuevoPatronResponsableArgs = {body: AltaPatronesResponsablesRequest}; export type CreateApiApiNuevoPatronResponsableOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Agrega nuevos patrones responsables * * POST /api/nuevoPatronResponsable */ export const createApiApiNuevoPatronResponsable = async (args: CreateApiApiNuevoPatronResponsableArgs, options: CreateApiApiNuevoPatronResponsableOptions) => { 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/nuevoPatronResponsable${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() };