Created a dashboard for teachers

This commit is contained in:
Tiago Ribeiro
2023-10-30 15:01:58 +00:00
parent dc13a4a7b7
commit bd6892dcf1
3 changed files with 229 additions and 2 deletions

View File

@@ -290,7 +290,13 @@ export default function GroupList({user}: {user: User}) {
<CreatePanel
group={editingID ? groups.find((x) => x.id === editingID) : undefined}
user={user}
users={users}
users={users.filter(
(u) =>
groups
.filter((g) => g.admin === user.id)
.flatMap((g) => g.participants)
.includes(u.id) || groups.flatMap((g) => g.participants).includes(u.id),
)}
onCreate={(group) => {
(!editingID ? createGroup : updateGroup)(group).then((result) => {
if (result) {