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:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user