From 7a33018e44cd43fd1c53e1155a82ca5ff2df15fc Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sun, 1 Dec 2024 12:18:09 +0800 Subject: [PATCH] :bug: Fix check user exists in realm bug --- pkg/internal/services/channel_members.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/internal/services/channel_members.go b/pkg/internal/services/channel_members.go index 7b835ed..9999833 100644 --- a/pkg/internal/services/channel_members.go +++ b/pkg/internal/services/channel_members.go @@ -72,7 +72,7 @@ func AddChannelMember(user authm.Account, target models.Channel) error { if err := database.C.Where(&models.ChannelMember{ AccountID: user.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") }