repair: add edit brand device

This commit is contained in:
2025-12-08 16:45:49 +07:00
parent 03be3a6a99
commit 5703ff0e8d
16 changed files with 1194 additions and 2198 deletions

View File

@@ -4,7 +4,6 @@ import SignIn from './pages/auth/SignIn';
import SignUp from './pages/auth/Signup';
import { ProtectedRoute } from './ProtectedRoute';
import NotFound from './pages/blank/NotFound';
import { BrandFormProvider } from './context/BrandFormContext';
// Dashboard
import Home from './pages/home/Home';
@@ -97,33 +96,26 @@ const App = () => {
<Route path="shift" element={<IndexShift />} />
<Route path="status" element={<IndexStatus />} />
{/* Brand Device Routes with BrandFormProvider */}
<Route path="brand-device/*" element={
<BrandFormProvider>
<Routes>
<Route path="" element={<IndexBrandDevice />} />
<Route path="add" element={<AddBrandDevice />} />
<Route path="edit/:id" element={<EditBrandDevice />} />
<Route path="view/:id" element={<ViewBrandDevice />} />
<Route
path="edit/:id/files/:fileType/:fileName"
element={<ViewFilePage />}
/>
<Route
path="view/:id/files/:fileType/:fileName"
element={<ViewFilePage />}
/>
<Route
path="view/temp/files/:fileName"
element={<ViewFilePage />}
/>
<Route path=":brandId/error-code/add" element={<AddEditErrorCode />} />
<Route path=":brandId/error-code/edit/:errorCodeId" element={<AddEditErrorCode />} />
<Route path="add/error-code/add" element={<AddEditErrorCode />} />
<Route path="add/error-code/edit/:errorCodeId" element={<AddEditErrorCode />} />
</Routes>
</BrandFormProvider>
} />
{/* Brand Device Routes */}
<Route path="brand-device" element={<IndexBrandDevice />} />
<Route path="brand-device/add" element={<AddBrandDevice />} />
<Route path="brand-device/edit/:id" element={<EditBrandDevice />} />
<Route path="brand-device/view/:id" element={<ViewBrandDevice />} />
<Route
path="brand-device/edit/:id/files/:fileType/:fileName"
element={<ViewFilePage />}
/>
<Route
path="brand-device/view/:id/files/:fileType/:fileName"
element={<ViewFilePage />}
/>
<Route
path="brand-device/view/temp/files/:fileName"
element={<ViewFilePage />}
/>
<Route path="brand-device/:brandId/error-code/add" element={<AddEditErrorCode />} />
<Route path="brand-device/:brandId/error-code/edit/:errorCodeId" element={<AddEditErrorCode />} />
<Route path="brand-device/add/error-code/edit/:errorCodeId" element={<AddEditErrorCode />} />
</Route>
<Route path="/report" element={<ProtectedRoute />}>