fix bug save and set data just with one key, remove page login from appo page, disable not avalaible data in calendar, change steps for pages in appo, get data user, edit and set in page user-info

This commit is contained in:
Ehsan
2025-08-31 01:21:59 +03:30
parent 09867bf84a
commit 1e70d88a84
20 changed files with 332 additions and 146 deletions
+18 -14
View File
@@ -1,29 +1,33 @@
import ArrowLeftB from "@/components/icons/ArrowLeftB";
import { request } from "@/services/response";
import { Button } from "@mui/material";
import Cookies from "js-cookie";
import { useParams } from "next/navigation";
import { useState } from "react";
function SendAppo({ hour }) {
function SendAppo({ hour, setStep }) {
const params = useParams();
const doctorId = params.doctorId;
const [loading, setLoading] = useState(false);
const sendReq = () => {
setLoading(true);
request
.postAppointment({
doctor_id: doctorId,
slot: hour,
})
.then(() => {
setLoading(false);
})
.catch(() => {
//
});
const isLogged = Cookies.get("access_token");
if (isLogged) {
setStep((step) => step + 1);
}
// setLoading(true);
// request
// .postAppointment({
// doctor_id: doctorId,
// slot: hour,
// })
// .then(() => {
// setLoading(false);
// })
// .catch(() => {
// //
// });
};
console.log(hour);
return (
<div className="w-full flex justify-end">
+2 -2
View File
@@ -10,7 +10,7 @@ import SendAppo from "./SendAppo";
const listTab = ["صبح", "بعد از ظهر"];
const nameHours = ["hours_morning", "hours_afternoon"];
function DateTime({ date, doctor }) {
function DateTime({ date, doctor, setStep }) {
const params = useParams();
const doctorId = params.doctorId;
const [value, setValue] = useState(0);
@@ -73,7 +73,7 @@ function DateTime({ date, doctor }) {
setHour={setHour}
nameHours={nameHours}
/>
<SendAppo hour={hour} />
<SendAppo hour={hour} setStep={setStep} />
</div>
);
}