Skip to content

Commit 41b34d3

Browse files
committed
fix: DMs as group issue
1 parent 9f2a13c commit 41b34d3

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

platforms/group-charter-manager-api/src/services/GroupService.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,15 @@ export class GroupService {
6161
});
6262
});
6363

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+
});
6871

69-
console.log("User groups found:", userGroups.length);
72+
console.log("User groups found (with minimum 3 participants):", userGroups.length);
7073
return userGroups;
7174
}
7275

0 commit comments

Comments
 (0)