Refactor employee management
This commit is contained in:
+6
-1
@@ -31,6 +31,11 @@ const AdminRoutes = () => {
|
||||
return <AdminLayout />;
|
||||
};
|
||||
|
||||
const AdminIndexRedirect = () => {
|
||||
const user = authApi.getCurrentUser();
|
||||
return <Navigate to={user?.role === 'technician' ? 'aftersales' : 'dashboard'} replace />;
|
||||
};
|
||||
|
||||
function App() {
|
||||
return (
|
||||
<BrowserRouter>
|
||||
@@ -46,7 +51,7 @@ function App() {
|
||||
|
||||
<Route element={<PrivateRoute />}>
|
||||
<Route element={<AdminRoutes />}>
|
||||
<Route path="/admin" element={<Navigate to="dashboard" replace />} />
|
||||
<Route path="/admin" element={<AdminIndexRedirect />} />
|
||||
<Route path="/admin/dashboard" element={<DashboardPage />} />
|
||||
<Route path="/admin/manage" element={<ManagePage />} />
|
||||
<Route path="/admin/employee-serials" element={<EmployeeSerialsPage />} />
|
||||
|
||||
Reference in New Issue
Block a user