fix: update user filtering to use user name instead of user ID

This commit is contained in:
Siemen Van den Neste
2026-03-29 20:37:18 +02:00
parent 4e94e82a01
commit 44f45c396c
2 changed files with 2 additions and 2 deletions
@@ -94,7 +94,7 @@ export function MachineFilters({ users, populatedNodes }: MachineFiltersProps):
const tagOwnedExists = populatedNodes.some((n) => !n.user);
const userOptions = [
...(tagOwnedExists ? [{ value: "tag-owned", label: "Tag-owned" }] : []),
...users.map((u) => ({ value: u.id, label: getUserDisplayName(u) })),
...users.map((u) => ({ value: u.name, label: getUserDisplayName(u) })),
];
const tagOptions = Array.from(new Set(populatedNodes.flatMap((n) => n.tags)))
+1 -1
View File
@@ -119,7 +119,7 @@ export default function Page({ loaderData }: Route.ComponentProps) {
node.givenName.toLowerCase().includes(query) ||
node.ipAddresses.some((ip) => ip.toLowerCase().includes(query))) &&
(filterUser === null ||
(filterUser === "tag-owned" ? !node.user : node.user?.id === filterUser)) &&
(filterUser === "tag-owned" ? !node.user : node.user?.name === filterUser)) &&
(filterTag === null || (node.tags?.includes(filterTag) ?? false)) &&
(filterStatus === null || STATUS_MATCH[filterStatus](node)) &&
(filterRoute === null || ROUTE_MATCH[filterRoute](node)),