feat(migration): dm moved
This commit is contained in:
33
frontend/src/routes/_old/old/(logistics)/dm/index.tsx
Normal file
33
frontend/src/routes/_old/old/(logistics)/dm/index.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
import { createFileRoute, redirect } from "@tanstack/react-router";
|
||||
import { checkUserAccess } from "@/lib/authClient";
|
||||
import DmPage from "../../-components/logistics/dm/dmPage";
|
||||
|
||||
export const Route = createFileRoute("/_old/old/(logistics)/dm/")({
|
||||
component: RouteComponent,
|
||||
beforeLoad: async () => {
|
||||
const auth = await checkUserAccess({
|
||||
allowedRoles: ["systemAdmin", "technician", "admin", "manager"],
|
||||
moduleName: "siloAdjustments", // optional
|
||||
});
|
||||
|
||||
if (!auth) {
|
||||
throw redirect({
|
||||
to: "/login",
|
||||
search: {
|
||||
// Use the current location to power a redirect after login
|
||||
// (Do not use `router.state.resolvedLocation` as it can
|
||||
// potentially lag behind the actual current location)
|
||||
redirect: location.pathname + location.search,
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
function RouteComponent() {
|
||||
return (
|
||||
<div>
|
||||
<DmPage />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user