fix(appointment): align request layer with real backend contract
- getAppointmentSlots uses doctor_uuid + date (was doctor_id, which the backend rejects with دکتر یافت نشد). - postAppointmentPayment posts to /api/v1/payment/appointment (was the nonexistent /api/v1/payment). - Remove getAppointmentNotAvailable: the not-available route does not exist (404); disabled dates come from the slots response. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -51,8 +51,6 @@ export const request = {
|
||||
Authorization: "",
|
||||
},
|
||||
}),
|
||||
getAppointmentNotAvailable: (doctor_id) =>
|
||||
api.get(`api/v1/appointment/not-available/${doctor_id}`, removeTokenHead),
|
||||
getAppointmentWeeklySchedule: (uuid) =>
|
||||
api.get(`api/v1/appointment-settings/weekly-schedule/${uuid}`),
|
||||
postAppointmentWeeklySchedule: () =>
|
||||
@@ -61,14 +59,15 @@ export const request = {
|
||||
api.patch(`api/v1/appointment-settings/weekly-schedule/${uuid}`),
|
||||
deleteAppointmentWeeklySchedule: (uuid) =>
|
||||
api.delete(`api/v1/appointment-settings/weekly-schedule/${uuid}`),
|
||||
getAppointment: (doctor_id, date) =>
|
||||
getAppointmentSlots: (doctor_uuid, date) =>
|
||||
api.get(
|
||||
`api/v1/appointment-slots?date=${date}&doctor_id=${doctor_id}`,
|
||||
`api/v1/appointment-slots?doctor_uuid=${doctor_uuid}&date=${date}`,
|
||||
removeTokenHead
|
||||
),
|
||||
postAppointment: (data) => api.post(`api/v1/appointment`, data, { requireAuth: true }),
|
||||
getMyAppointments: (userId, params) => api.get(`api/v1/appointment/my-appointments/${userId}`, { params, requireAuth: true }),
|
||||
postPayment: (data) => api.post(`api/v1/payment`, data, { requireAuth: true }),
|
||||
postAppointmentPayment: (data) =>
|
||||
api.post(`api/v1/payment/appointment`, data, { requireAuth: true }),
|
||||
getPayment: (uuid) => api.get(`api/v1/payment/${uuid}`, { requireAuth: true }),
|
||||
getMyPayments: (userId, params) => api.get(`api/v1/payment/my-payments/${userId}`, { params, requireAuth: true }),
|
||||
postDoctor: (data) => api.post("api/v1/doctor", data),
|
||||
|
||||
Reference in New Issue
Block a user