🐛 Fix check user exists in realm bug
This commit is contained in:
parent
17694d398b
commit
7a33018e44
@ -72,7 +72,7 @@ func AddChannelMember(user authm.Account, target models.Channel) error {
|
|||||||
if err := database.C.Where(&models.ChannelMember{
|
if err := database.C.Where(&models.ChannelMember{
|
||||||
AccountID: user.ID,
|
AccountID: user.ID,
|
||||||
ChannelID: target.ID,
|
ChannelID: target.ID,
|
||||||
}).First(&member).Error; err == nil || errors.Is(err, gorm.ErrRecordNotFound) {
|
}).First(&member).Error; err == nil || !errors.Is(err, gorm.ErrRecordNotFound) {
|
||||||
return fmt.Errorf("the user is already in the channel")
|
return fmt.Errorf("the user is already in the channel")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user