fix(doctor): correct rating/comment API paths to real backend routes
Doctor page logged a 404 on GET /api/v1/clinicpro/rate/{uuid}. The
frontend used a stale Drupal-era `clinicpro/` prefix; the Symfony API
exposes these under /api/v1 directly.
- response.js: rate/comments/like wrappers point to real routes
(rate/{uuid}, comments/{uuid}, POST rate, POST comment,
POST like/{commentUuid}); patch maps to POST upsert; writes use
requireAuth. Add getDoctorComments wrapper.
- doctor page: fetch comments from comments/{doctor.uuid} (was
clinicpro/comments/{doctor.id}) and unwrap double-nested data.
- ItemUser: postCommentsLike sends commentUuid for the toggle endpoint.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -87,12 +87,13 @@ export const request = {
|
||||
}),
|
||||
getDoctorServices: () =>
|
||||
api.get("api/v1/categorys/doctor_services", removeTokenHead),
|
||||
postDoctorComment: (data) => api.post("api/v1/clinicpro/comment", data),
|
||||
getDoctorRate: (uuid) => api.get(`api/v1/clinicpro/rate/${uuid}`),
|
||||
postDoctorRate: (data) => api.post("api/v1/clinicpro/rate", data),
|
||||
patchDoctorRate: (data, uuid) =>
|
||||
api.patch(`api/v1/clinicpro/rate/${uuid}`, data),
|
||||
postCommentsLike: (data) => api.post("/api/v1/clinicpro/like", data),
|
||||
postDoctorComment: (data) => api.post("api/v1/comment", data, { requireAuth: true }),
|
||||
getDoctorRate: (uuid) => api.get(`api/v1/rate/${uuid}`),
|
||||
getDoctorComments: (uuid) => api.get(`api/v1/comments/${uuid}`),
|
||||
postDoctorRate: (data) => api.post("api/v1/rate", data, { requireAuth: true }),
|
||||
patchDoctorRate: (data) => api.post("api/v1/rate", data, { requireAuth: true }),
|
||||
postCommentsLike: (commentUuid) =>
|
||||
api.post(`api/v1/like/${commentUuid}`, null, { requireAuth: true }),
|
||||
getClinicList: (params) =>
|
||||
api.get("/api/v1/clinics", {
|
||||
params,
|
||||
|
||||
Reference in New Issue
Block a user