handle limit page dashboard & change header profile user & get data from api in page clinics & clinic item and doctor item
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { Button } from "@mui/material";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { request } from "@/services/response";
|
||||
import Cookies from "js-cookie";
|
||||
|
||||
@@ -12,8 +11,6 @@ function SendReq({
|
||||
setIsError,
|
||||
uuid,
|
||||
}) {
|
||||
const router = useRouter();
|
||||
|
||||
const handleSetCookie = (response) => {
|
||||
const accessTokenExpires = new Date();
|
||||
accessTokenExpires.setSeconds(
|
||||
@@ -50,7 +47,7 @@ function SendReq({
|
||||
.then((response) => {
|
||||
setLoading(false);
|
||||
if (response.access_token) {
|
||||
router.replace("/");
|
||||
window.location.pathname = "/";
|
||||
handleSetCookie(response);
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user