🐛 Fix posts filter with user context filtered all the posts
This commit is contained in:
parent
25eb0585d5
commit
79a61cc732
@ -132,7 +132,9 @@ func FilterPostWithUserContext(tx *gorm.DB, user *authm.Account) *gorm.DB {
|
|||||||
datatypes.JSONQuery("invisible_users").HasKey(strconv.Itoa(int(user.ID))),
|
datatypes.JSONQuery("invisible_users").HasKey(strconv.Itoa(int(user.ID))),
|
||||||
)
|
)
|
||||||
|
|
||||||
tx = tx.Where("publisher_id NOT IN ?", invisibleList)
|
if len(invisibleList) > 0 {
|
||||||
|
tx = tx.Where("publisher_id NOT IN ?", invisibleList)
|
||||||
|
}
|
||||||
|
|
||||||
return tx
|
return tx
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user