export type EventosSociales = {descripcion?: string | undefined, estatus?: string | undefined, fecha?: string | undefined, id?: number | undefined, imagen?: string | undefined, lugar?: string | undefined, nombre?: string | undefined, tipo?: string | undefined}; export type CreateApiApiEventoSocialArgs = {body: EventosSociales}; export type CreateApiApiEventoSocialOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * newEventoSocial * * POST /api/evento/social */ export const createApiApiEventoSocial = async (args: CreateApiApiEventoSocialArgs, options: CreateApiApiEventoSocialOptions) => { 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/evento/social${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() };