// Caminho: services/relatoriosApi.ts import api from './api'; export interface Report { id: any; patient_id: string; exam: string; [key: string]: any; } export const relatoriosApi = { list: async (): Promise => { const response = await api.get('/rest/v1/reports?select=*'); return response.data; }, getById: async (id: string): Promise => { const response = await api.get(`/rest/v1/reports?id=eq.${id}&select=*`, { headers: { Accept: 'application/vnd.pgrst.object+json' }, }); return response.data; }, create: async (data: Omit): Promise => { const response = await api.post('/rest/v1/reports', data, { headers: { 'Prefer': 'return=representation' } }); return response.data[0]; }, update: async (id: string, data: Partial): Promise => { const response = await api.patch(`/rest/v1/reports?id=eq.${id}`, data, { headers: { 'Prefer': 'return=representation' } }); return response.data[0]; }, delete: async (id: string): Promise => { await api.delete(`/rest/v1/reports?id=eq.${id}`); }, };