🐛 Fix get available channel in global also read channels in realm
This commit is contained in:
@@ -156,6 +156,8 @@ func ListAvailableChannel(tx *gorm.DB, user models.Account, realmId ...uint) ([]
|
|||||||
tx = tx.Preload("Realm").Where("id IN ?", idx)
|
tx = tx.Preload("Realm").Where("id IN ?", idx)
|
||||||
if len(realmId) > 0 {
|
if len(realmId) > 0 {
|
||||||
tx = tx.Where("realm_id = ?", realmId)
|
tx = tx.Where("realm_id = ?", realmId)
|
||||||
|
} else {
|
||||||
|
tx = tx.Where("realm_id IS NULL")
|
||||||
}
|
}
|
||||||
|
|
||||||
tx = PreloadDirectChannelMembers(tx)
|
tx = PreloadDirectChannelMembers(tx)
|
||||||
|
Reference in New Issue
Block a user