diff --git a/database/group.go b/database/group.go index fe57b2e..4b5f5df 100644 --- a/database/group.go +++ b/database/group.go @@ -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)