From 81121ad7d76c00b8ea149e6ce9a539d2cf5a54e0 Mon Sep 17 00:00:00 2001 From: hamed <15238-genius.ha@users.noreply.drupalcode.org> Date: Mon, 15 Jun 2026 15:47:21 +0330 Subject: [PATCH] fix(appointment): convert picker timestamp to date and fix summary panel Follow-ups found while sweeping for stale shapes: - The date picker emits a unix timestamp, but appointment-slots needs Y-m-d; convert with moment before calling (slots never loaded before). - Appointment summary (information/Detail.js) used the auth-required getDoctorAddress and selectedSlot.time; derive the address from the loaded doctor.address by location_id and use selectedSlot.start_time. - SendAppo: drop the dead postAppointment block, unused useParams/loading, and a duplicate disabled prop on the button. Co-Authored-By: Claude Opus 4.8 --- app/component/date/dateTime/SendAppo.js | 20 -------------- app/component/date/dateTime/index.js | 4 ++- components/appointment/information/Detail.js | 28 ++++---------------- 3 files changed, 8 insertions(+), 44 deletions(-) diff --git a/app/component/date/dateTime/SendAppo.js b/app/component/date/dateTime/SendAppo.js index 0252413..734caf9 100644 --- a/app/component/date/dateTime/SendAppo.js +++ b/app/component/date/dateTime/SendAppo.js @@ -1,14 +1,8 @@ import ArrowLeftB from "@/components/icons/ArrowLeftB"; import { Button } from "@mui/material"; import Cookies from "js-cookie"; -import { useParams } from "next/navigation"; -import { useState } from "react"; function SendAppo({ hour, setStep, setSelectedSlot, date, setSelectedDate }) { - const params = useParams(); - const doctorId = params.doctorId; - const [loading, setLoading] = useState(false); - const sendReq = () => { const isLogged = Cookies.get("access_token"); @@ -25,19 +19,6 @@ function SendAppo({ hour, setStep, setSelectedSlot, date, setSelectedDate }) { // اگر لاگین نکرده، به مرحله 1 (Login) می‌رود setStep(1); } - - // setLoading(true); - // request - // .postAppointment({ - // doctor_id: doctorId, - // slot: hour, - // }) - // .then(() => { - // setLoading(false); - // }) - // .catch(() => { - // // - // }); }; return ( @@ -45,7 +26,6 @@ function SendAppo({ hour, setStep, setSelectedSlot, date, setSelectedDate }) {