refactor: implement login state management and navigation flow in appointment components
This commit is contained in:
@@ -11,9 +11,15 @@ function SendAppo({ hour, setStep }) {
|
||||
|
||||
const sendReq = () => {
|
||||
const isLogged = Cookies.get("access_token");
|
||||
|
||||
if (isLogged) {
|
||||
setStep((step) => step + 1);
|
||||
// اگر لاگین کرده، به مرحله 3 (Detail) میرود
|
||||
setStep(3);
|
||||
} else {
|
||||
// اگر لاگین نکرده، به مرحله 1 (Login) میرود
|
||||
setStep(1);
|
||||
}
|
||||
|
||||
// setLoading(true);
|
||||
// request
|
||||
// .postAppointment({
|
||||
|
||||
Reference in New Issue
Block a user