Solved issues related to the build
This commit is contained in:
@@ -21,7 +21,7 @@ export default function UserList({user}: {user: User}) {
|
||||
const [showDemographicInformation, setShowDemographicInformation] = useState(false);
|
||||
|
||||
const {users, reload} = useUsers();
|
||||
const {groups} = useGroups(user.id);
|
||||
const {groups} = useGroups(user ? user.id : undefined);
|
||||
|
||||
const deleteAccount = (user: User) => {
|
||||
if (!confirm(`Are you sure you want to delete ${user.name}'s account?`)) return;
|
||||
@@ -245,7 +245,10 @@ export default function UserList({user}: {user: User}) {
|
||||
];
|
||||
|
||||
const table = useReactTable({
|
||||
data: user.type === "admin" || user.type === "student" ? users.filter((u) => groups.flatMap((g) => g.participants).includes(u.id)) : users,
|
||||
data:
|
||||
user && (user.type === "admin" || user.type === "student")
|
||||
? users.filter((u) => groups.flatMap((g) => g.participants).includes(u.id))
|
||||
: users,
|
||||
columns: (!showDemographicInformation ? defaultColumns : demographicColumns) as any,
|
||||
getCoreRowModel: getCoreRowModel(),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user