fix: likes query joins

This commit is contained in:
əlemi 2024-12-27 02:16:22 +01:00
parent 408f760672
commit 256e880d6c
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -31,9 +31,9 @@ pub async fn page(
let (limit, offset) = page.pagination();
let items : Vec<serde_json::Value> = upub::Query::objects(auth.my_id(), true)
.join(sea_orm::JoinType::InnerJoin, upub::model::like::Relation::Objects.def())
.join(sea_orm::JoinType::InnerJoin, upub::model::activity::Relation::Likes.def())
let items : Vec<serde_json::Value> = upub::Query::objects(None, true)
.join(sea_orm::JoinType::InnerJoin, upub::model::object::Relation::Likes.def())
.join(sea_orm::JoinType::InnerJoin, upub::model::like::Relation::Activities.def())
.filter(auth.filter_activities())
.filter(upub::model::like::Column::Actor.eq(user.internal))
.order_by_desc(upub::model::like::Column::Published)