Compare commits

..

2 Commits

Author SHA1 Message Date
Natty 607cb2ded2
Clarified tables in subselect
ci/woodpecker/push/ociImagePush Pipeline was successful Details
2024-09-05 19:33:57 +02:00
Natty aebc9803db
Wrong column, really wrong
ci/woodpecker/push/ociImagePush Pipeline was successful Details
2024-09-05 18:48:29 +02:00
1 changed files with 4 additions and 8 deletions

View File

@ -47,16 +47,12 @@ impl NoteResolveMode {
NoteResolveMode::Multiple(ids) => id_col.is_in(ids),
NoteResolveMode::PinsFromUserId(user_id) => {
let sub_query = Query::select()
.expr(SelectExpr {
expr: Expr::col(user_note_pining::Column::NoteId).into(),
alias: None,
window: None,
})
.column(user_note_pining::Column::NoteId)
.from(user_note_pining::Entity)
.and_where(Expr::col(note_reaction::Column::UserId).eq(user_id))
.and_where(Expr::col((user_note_pining::Entity, user_note_pining::Column::UserId)).eq(user_id))
.order_by_columns([
(user_note_pining::Column::CreatedAt, Order::Desc),
(user_note_pining::Column::Id, Order::Desc)
((user_note_pining::Entity, user_note_pining::Column::CreatedAt), Order::Desc),
((user_note_pining::Entity, user_note_pining::Column::Id), Order::Desc)
])
.take();