created different file for the routes, and changes all the import
This commit is contained in:
1 parent
73b31778db
commit
45444ba8bd
4 files changed
+16
-6
No files matched your search
@@ -14,6 +14,7 @@ import {
|
||||
XCircle,
|
||||
LayoutDashboard,
|
||||
} from "lucide-react";
|
||||
import { ROUTES } from "@/lib/routes";
|
||||
|
||||
type FilterStatus = "All" | "Pending" | "Approved" | "Rejected";
|
||||
|
||||
@@ -32,8 +33,10 @@ export default function ManagerPage() {
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isLoading && !user) router.replace("/");
|
||||
else if (!isLoading && user?.role === "employee") router.replace("/employee");
|
||||
// if (!isLoading && !user) router.replace("/");
|
||||
// else if (!isLoading && user?.role === "employee") router.replace("/employee");
|
||||
if (!isLoading && !user) router.replace(ROUTES.home);
|
||||
else if (!isLoading && user?.role === "employee") router.replace(ROUTES.employee);
|
||||
else if (!isLoading && user) loadData();
|
||||
}, [user, isLoading, router, loadData]);
|
||||
|
||||
|
||||
Reference in new issue
Block a user