diff --git a/apps/web/src/app/(portal)/admin/modules/grants/page.tsx b/apps/web/src/app/(portal)/admin/modules/grants/page.tsx index 4fabfcb..a271cb9 100644 --- a/apps/web/src/app/(portal)/admin/modules/grants/page.tsx +++ b/apps/web/src/app/(portal)/admin/modules/grants/page.tsx @@ -16,6 +16,7 @@ interface Module { interface Group { id: string; name: string; + internalName?: string | null; } interface GrantPair { @@ -138,7 +139,10 @@ export default function AdminModuleGrantsPage() { [modules, searchLower], ); const filteredGroups = useMemo( - () => groups.filter((g) => matches(g.name)), + // Matches both the display name (internalName ?? name) and the stored + // AD name — a search for either the internal or the AD-original name + // must find the group (D-04). + () => groups.filter((g) => matches(g.internalName ?? g.name) || matches(g.name)), // eslint-disable-next-line react-hooks/exhaustive-deps [groups, searchLower], ); @@ -206,10 +210,10 @@ export default function AdminModuleGrantsPage() { {filteredGroups.map((g) => (