Improved the bug on the teachers
This commit is contained in:
@@ -212,6 +212,12 @@ export default function GroupList({user}: {user: User}) {
|
||||
userType: user?.type,
|
||||
});
|
||||
|
||||
const {groups: corporateGroups} = useGroups({
|
||||
admin: user && filterTypes.includes(user?.type) ? user.id : undefined,
|
||||
userType: user?.type,
|
||||
adminAdmins: user?.id,
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (user && ["corporate", "teacher", "mastercorporate"].includes(user.type)) {
|
||||
setFilterByUser(true);
|
||||
@@ -309,7 +315,8 @@ export default function GroupList({user}: {user: User}) {
|
||||
groups
|
||||
.filter((g) => g.admin === user.id)
|
||||
.flatMap((g) => g.participants)
|
||||
.includes(u.id) || groups.flatMap((g) => g.participants).includes(u.id),
|
||||
.includes(u.id) ||
|
||||
(user?.type === "teacher" ? corporateGroups : groups).flatMap((g) => g.participants).includes(u.id),
|
||||
)
|
||||
: users
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user