Created a dashboard for teachers
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user