File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
platforms/group-charter-manager-api/src/services Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -61,12 +61,15 @@ export class GroupService {
61
61
} ) ;
62
62
} ) ;
63
63
64
- // Filter groups where user is a participant
65
- const userGroups = allGroups . filter ( group =>
66
- group . participants ?. some ( participant => participant . id === userId )
67
- ) ;
64
+ // Filter groups where user is a participant AND group has at least 3 participants
65
+ const userGroups = allGroups . filter ( group => {
66
+ const isUserParticipant = group . participants ?. some ( participant => participant . id === userId ) ;
67
+ const hasMinimumParticipants = group . participants && group . participants . length >= 3 ;
68
+
69
+ return isUserParticipant && hasMinimumParticipants ;
70
+ } ) ;
68
71
69
- console . log ( "User groups found:" , userGroups . length ) ;
72
+ console . log ( "User groups found (with minimum 3 participants) :" , userGroups . length ) ;
70
73
return userGroups ;
71
74
}
72
75
You can’t perform that action at this time.
0 commit comments