From be1beb713c6fe8c2f326399d48c9c33d8a178776 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sat, 22 Feb 2025 13:02:38 +0800 Subject: [PATCH] :bug: Fix filter with realm --- pkg/internal/services/posts.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/internal/services/posts.go b/pkg/internal/services/posts.go index 475f29e..f2d26e3 100644 --- a/pkg/internal/services/posts.go +++ b/pkg/internal/services/posts.go @@ -156,7 +156,7 @@ func FilterPostWithUserContext(tx *gorm.DB, user *authm.Account, withRealm bool) } if !withRealm { if len(realmList) > 0 { - tx = tx.Where("realm_id IN ?", realmList) + tx = tx.Where("realm_id IN ? OR realm_id IS NULL", realmList) } else { tx = tx.Where("realm_id IS NULL") }