Files
co-lite/solvway-admin-portal/app/lib/routeModules.ts
T
ngqileandClaude Opus 5.5 82b6943474 feat(admin-portal): leads listing and lead detail
Lead Listing with search and server paging, lead detail with event
history, shared-contact warning and an edit form under BO_LEADS_EDIT,
and a View lead link from the event lead edit page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
2026-11-27 16:53:44 +08:00

22 lines
856 B
TypeScript

// Route -> required module name. Values are the seeded aclMenu `name` column (BO_USERS, ...), NOT the `desc`
// display label: the route gate RequireModule -> useAdminAuth().hasModule(x) matches a flattened aclMenu node by
// `name` or `url` only, so a desc label here never matches and a granted user would wrongly see the
// not-authorised state.
export const ROUTE_MODULES: Record<string, string> = {
"/users": "BO_USERS",
"/roles": "BO_ROLES",
"/events": "BO_EVENTS",
"/interests": "BO_INTERESTS",
"/event-leads": "BO_EVENT_LEADS",
"/leads": "BO_LEADS",
};
export function requiredModuleFor(pathname: string): string | undefined {
return ROUTE_MODULES[pathname];
}
export function requiredModulesFor(pathname: string): readonly string[] | undefined {
const single = ROUTE_MODULES[pathname];
return single ? [single] : undefined;
}