🐛 Fix column naming issue in where statement
This commit is contained in:
parent
f07364269a
commit
0fd742ffd2
@ -38,8 +38,8 @@ type Post struct {
|
|||||||
RepostTo *Post `json:"repost_to" gorm:"foreignKey:RepostID"`
|
RepostTo *Post `json:"repost_to" gorm:"foreignKey:RepostID"`
|
||||||
Realm *Realm `json:"realm"`
|
Realm *Realm `json:"realm"`
|
||||||
|
|
||||||
VisibleUsers datatypes.JSONSlice[uint] `json:"visible_users"`
|
VisibleUsers datatypes.JSONSlice[uint] `json:"visible_users_list"`
|
||||||
InvisibleUsers datatypes.JSONSlice[uint] `json:"invisible_users"`
|
InvisibleUsers datatypes.JSONSlice[uint] `json:"invisible_users_list"`
|
||||||
Visibility PostVisibilityLevel `json:"visibility"`
|
Visibility PostVisibilityLevel `json:"visibility"`
|
||||||
|
|
||||||
EditedAt *time.Time `json:"edited_at"`
|
EditedAt *time.Time `json:"edited_at"`
|
||||||
|
@ -19,8 +19,8 @@ func FilterPostWithUserContext(tx *gorm.DB, user *models.Account) *gorm.DB {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tx = tx.Where("visibility != ?", models.PostVisibilityFriends) // TODO Blocked by dealer, need support get friend list
|
tx = tx.Where("visibility != ?", models.PostVisibilityFriends) // TODO Blocked by dealer, need support get friend list
|
||||||
tx = tx.Where("visibility = ? AND ? = ANY (visible_users_list::jsonb[])", models.PostVisibilitySelected, user.ID)
|
tx = tx.Where("visibility = ? AND ? = ANY (visible_users::jsonb[])", models.PostVisibilitySelected, user.ID)
|
||||||
tx = tx.Where("visibility = ? AND NOT ( ? = ANY (invisible_users_list::jsonb[]) )", models.PostVisibilitySelected, user.ID)
|
tx = tx.Where("visibility = ? AND NOT ( ? = ANY (invisible_users::jsonb[]) )", models.PostVisibilitySelected, user.ID)
|
||||||
tx = tx.Where("visibility != ?", models.PostVisibilityNone)
|
tx = tx.Where("visibility != ?", models.PostVisibilityNone)
|
||||||
|
|
||||||
return tx
|
return tx
|
||||||
|
Loading…
Reference in New Issue
Block a user