Groups stuff

This commit is contained in:
Tiago Ribeiro
2024-12-12 15:19:44 +00:00
parent 858e29eb93
commit 3b6836c15a
2 changed files with 37 additions and 37 deletions

View File

@@ -35,7 +35,7 @@ export const getServerSideProps = withIronSessionSsr(async ({ req, res }) => {
const groups = await getGroupsForEntities(mapBy(allowedEntities, 'id'));
const users = await getSpecificUsers(uniq(groups.flatMap((g) => [...g.participants, g.admin])));
const groupsWithUsers: GroupWithUsers[] = groups.map((g) => convertToUsers(g, users));
const groupsWithUsers: GroupWithUsers[] = groups.map((g) => convertToUsers(g, users.filter(x => isAdmin(user) ? true : !isAdmin(x))));
return {
props: serialize({ user, groups: groupsWithUsers, entities: allowedEntities }),