From afb3b939e79749894e822988451f0d22f994992c Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sat, 5 Oct 2024 22:04:15 +0800 Subject: [PATCH] :bug: Fix get available channel in global also read channels in realm --- pkg/internal/services/channels.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/internal/services/channels.go b/pkg/internal/services/channels.go index 3778dfc..0a1f79f 100644 --- a/pkg/internal/services/channels.go +++ b/pkg/internal/services/channels.go @@ -156,6 +156,8 @@ func ListAvailableChannel(tx *gorm.DB, user models.Account, realmId ...uint) ([] tx = tx.Preload("Realm").Where("id IN ?", idx) if len(realmId) > 0 { tx = tx.Where("realm_id = ?", realmId) + } else { + tx = tx.Where("realm_id IS NULL") } tx = PreloadDirectChannelMembers(tx)