From 6e215d5ae23fe2247189e6eeec5487e5232cbc78 Mon Sep 17 00:00:00 2001 From: StsDanilo Date: Thu, 16 Oct 2025 09:04:03 -0300 Subject: [PATCH] pequeno ajuste para api --- services/availabilityApi.mjs | 11 ++++++----- services/exceptionApi.mjs | 1 + services/patientsApi.mjs | 10 +++++----- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/services/availabilityApi.mjs b/services/availabilityApi.mjs index 71be51e..40b7fcf 100644 --- a/services/availabilityApi.mjs +++ b/services/availabilityApi.mjs @@ -1,8 +1,9 @@ import { api } from "./api.mjs"; export const AvailabilityService = { - list: () => api.get("/rest/v1/doctor_availability"), - create: (data) => api.post("/rest/v1/doctor_availability", data), - update: (id, data) => api.patch(`/rest/v1/doctor_availability?id=eq.${id}`, data), - delete: (id) => api.delete(`/rest/v1/doctor_availability/{id}?id=eq.${id}`), -}; \ No newline at end of file + list: () => api.get("/rest/v1/doctor_availability"), + listById: (id) => api.get(`/rest/v1/doctor_availability?doctor_id=eq.${id}`), + create: (data) => api.post("/rest/v1/doctor_availability", data), + update: (id, data) => api.patch(`/rest/v1/doctor_availability?id=eq.${id}`, data), + delete: (id) => api.delete(`/rest/v1/doctor_availability?id=eq.${id}`), +}; diff --git a/services/exceptionApi.mjs b/services/exceptionApi.mjs index c0b3c0e..62e893e 100644 --- a/services/exceptionApi.mjs +++ b/services/exceptionApi.mjs @@ -2,6 +2,7 @@ import { api } from "./api.mjs"; export const exceptionsService = { list: () => api.get("/rest/v1/doctor_exceptions"), + listById: () => api.get(`/rest/v1/doctor_exceptions?id=eq.${id}`), create: (data) => api.post("/rest/v1/doctor_exceptions", data), delete: (id) => api.delete(`/rest/v1/doctor_exceptions?id=eq.${id}`), }; diff --git a/services/patientsApi.mjs b/services/patientsApi.mjs index 2a5ba54..5eb1e7c 100644 --- a/services/patientsApi.mjs +++ b/services/patientsApi.mjs @@ -1,9 +1,9 @@ import { api } from "./api.mjs"; export const patientsService = { - list: () => api.get("/rest/v1/patients"), - getById: (id) => api.get(`/rest/v1/patients?id=eq.${id}`), - create: (data) => api.post("/rest/v1/patients", data), - update: (id, data) => api.patch(`/rest/v1/patients?id=eq.${id}`, data), - delete: (id) => api.delete(`/rest/v1/patients?id=eq.${id}`), + list: () => api.get("/rest/v1/patients"), + getById: (id) => api.get(`/rest/v1/patients?id=eq.${id}`), + create: (data) => api.post("/rest/v1/patients", data), + update: (id, data) => api.patch(`/rest/v1/patients?id=eq.${id}`, data), + delete: (id) => api.delete(`/rest/v1/patients?id=eq.${id}`), };