👔 No longer return error when trying add a member who already in the realm

This commit is contained in:
LittleSheep 2025-02-10 18:01:32 +08:00
parent 271e61510e
commit a08372d4d2

View File

@ -116,7 +116,7 @@ func AddRealmMember(user models.Account, affected models.Account, target models.
AccountID: affected.ID,
RealmID: target.ID,
}).First(&member).Error; err == nil || !errors.Is(err, gorm.ErrRecordNotFound) {
return fmt.Errorf("the user is already in the realm")
return nil
}
if !target.IsPublic && !target.IsCommunity {