fix: remove invalid lowercase employee role comparisons

Remove invalid comparisons against lowercase 'employee' role that don't exist
in the User type. The role type only includes uppercase 'EMPLOYEE'.

Fixed in:
- app/employe/dashboard/page.tsx (lines 42, 117)
- app/employe/layout.tsx (lines 28, 48)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
soufiane 2025-11-18 00:34:50 +01:00
parent f168f24072
commit 84d42132ad
2 changed files with 4 additions and 4 deletions

View File

@ -39,7 +39,7 @@ export default function EmployeDashboardPage() {
return;
}
if (isAuthenticated && user?.role !== 'EMPLOYEE' && user?.role !== 'employee') {
if (isAuthenticated && user?.role !== 'EMPLOYEE') {
router.push(ROUTES.HOME);
toast.error('Accès refusé : rôle employé requis');
return;
@ -114,7 +114,7 @@ export default function EmployeDashboardPage() {
);
}
if (!isAuthenticated || (user?.role !== 'EMPLOYEE' && user?.role !== 'employee')) {
if (!isAuthenticated || user?.role !== 'EMPLOYEE') {
return null;
}

View File

@ -25,7 +25,7 @@ export default function EmployeLayout({
return;
}
if (isAuthenticated && user?.role !== "EMPLOYEE" && user?.role !== "employee") {
if (isAuthenticated && user?.role !== "EMPLOYEE") {
router.push("/");
toast.error("Accès refusé : rôle employé requis");
return;
@ -45,7 +45,7 @@ export default function EmployeLayout({
);
}
if (!isAuthenticated || (user?.role !== "EMPLOYEE" && user?.role !== "employee")) {
if (!isAuthenticated || user?.role !== "EMPLOYEE") {
return null;
}