Skip to content

Commit

Permalink
fix: do not show same group multiple times
Browse files Browse the repository at this point in the history
  • Loading branch information
domrim committed Aug 30, 2024
1 parent 0664807 commit 08d3547
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion database/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func GetGroupsAUserIsAMemberOf(UserID uuid.UUID) ([]models.Group, error) {
var groups []models.Group

// Retrieve groups that the user is a member of
groupRecords := Instance.
groupRecords := Instance.Distinct().
Where(&models.Group{Enabled: true}).
Joins("JOIN group_memberships ON group_memberships.group_id = groups.id", Instance.Where(&models.GroupMembership{Enabled: true, MemberID: UserID})).
Find(&groups)
Expand Down

0 comments on commit 08d3547

Please sign in to comment.