🐛 Fix permissions in groups

This commit is contained in:
2024-07-24 18:09:18 +08:00
parent 7737d9fd08
commit c458123d9e
4 changed files with 24 additions and 7 deletions

View File

@ -15,8 +15,8 @@ func GetUserAccountGroup(user models.Account) ([]models.AccountGroup, error) {
}
var groups []models.AccountGroup
if err := database.C.Where("id IN ?", lo.Map(groups, func(item models.AccountGroup, index int) uint {
return item.ID
if err := database.C.Where("id IN ?", lo.Map(members, func(item models.AccountGroupMember, index int) uint {
return item.GroupID
})).Find(&groups).Error; err != nil {
return nil, err
}