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 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
import moment from "moment-jalaali";
|
||||
import Hours from "./hours";
|
||||
import Tabs from "../../Tabs";
|
||||
import { request } from "@/services/response";
|
||||
@@ -28,8 +29,9 @@ function DateTime({ date, doctor, setStep, setSelectedSlot, setSelectedDate }) {
|
||||
if (date && doctor?.uuid) {
|
||||
setAppo("loading");
|
||||
setHour();
|
||||
const dateStr = moment.unix(date).format("YYYY-MM-DD");
|
||||
request
|
||||
.getAppointmentSlots(doctor.uuid, date)
|
||||
.getAppointmentSlots(doctor.uuid, dateStr)
|
||||
.then((res) => {
|
||||
const slots = adaptSlots(res);
|
||||
setAppo(slots);
|
||||
|
||||
Reference in New Issue
Block a user