feat(doctor): wire rich rating/review UI to multi-dimensional API
Connect the existing doctor-page review UI to the rebuilt backend contract
(see clinicpro feat/rating-multidimensional).
- page.js fetches the rating aggregate alongside comments and passes
rateAggregate down to the chart (point / satisfaction / 5 dimensions).
- Submit form sends the five dimensions with doctor_uuid; comment/reply
send {doctor_uuid, comment, parent}; 401/403 ERR_RATING_NOT_ELIGIBLE
surface friendly guidance.
- Like/dislike call POST /like/{uuid} with value and update from the
response; replies render nested.
- ModalAnswer gates the submit button on GET /rate/{uuid}/eligibility.
- services/response.js: getRateEligibility, postCommentsLike(uuid, value),
drop unused patchDoctorRate. Fix hardcoded modal title; empty-state for
no comments. Remove orphaned AnswerField.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1,20 +1,11 @@
|
||||
import React from "react";
|
||||
import ItemUser from "./ItemUser";
|
||||
|
||||
function Replies({ data, update, setUpdate }) {
|
||||
function Replies({ data, doctor }) {
|
||||
return (
|
||||
<ul
|
||||
className={`flex pr-12 flex-col justify-center transition-all duration-500 overflow-hidden items-start gap-12 w-full
|
||||
${data.is_open_reply ? "max-h-fit mt-12" : "max-h-0"}`}
|
||||
>
|
||||
{data.replies.map((item, idx) => (
|
||||
<ItemUser
|
||||
key={idx}
|
||||
data={item}
|
||||
isReply={true}
|
||||
update={update}
|
||||
setUpdate={setUpdate}
|
||||
/>
|
||||
<ul className="flex pr-12 flex-col justify-center mt-12 items-start gap-12 w-full">
|
||||
{data.replies.map((item) => (
|
||||
<ItemUser key={item.uuid} data={item} doctor={doctor} isReply={true} />
|
||||
))}
|
||||
</ul>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user