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:
hamed
2026-06-15 23:07:20 +03:30
co-authored by Claude Opus 4.8
parent a79a6c0629
commit 12917cd900
3 changed files with 10 additions and 14 deletions
+1 -6
View File
@@ -22,13 +22,8 @@ function ItemUser({ update, setUpdate, data }) {
if (type === "like") setLoadingLike(true);
else setLoadingDislike(true);
const body = {
comment_id: data.id,
like: type === "like" ? 1 : 0,
};
try {
const res = await request.postCommentsLike(body);
const res = await request.postCommentsLike(data.uuid ?? data.id);
} catch (err) {
// err
} finally {