export type DiscrepanciaRequest = {caseta?: string | undefined, coincide?: boolean | undefined, fecha?: string | undefined, foto?: string | undefined, hora?: string | undefined, idcaseta?: number | undefined, idusuario?: number | undefined, idvehiculo?: number | undefined, placa?: string | undefined, vehiculo?: string | undefined}; export type CreateApiApiDicrepanciaArgs = {body: DiscrepanciaRequest}; export type CreateApiApiDicrepanciaOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Agrega nuevos dicrepancia * * POST /api/dicrepancia */ export const createApiApiDicrepancia = async (args: CreateApiApiDicrepanciaArgs, options: CreateApiApiDicrepanciaOptions) => { 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/dicrepancia${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() };