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)