Refactor employee management

This commit is contained in:
Frudrax Cheng
2026-05-28 10:05:56 +08:00
parent 8b930ff44d
commit b9bc8f5419
11 changed files with 285 additions and 1051 deletions
+6 -1
View File
@@ -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 />} />