fix: maybe don't filter whole queries
This commit is contained in:
parent
a4cdd2e67b
commit
8af2cd2664
1 changed files with 7 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
||||||
use apb::{ActivityMut, CollectionMut, ObjectMut};
|
use apb::{ActivityMut, CollectionMut, ObjectMut};
|
||||||
use sea_orm::{entity::prelude::*, Condition, FromQueryResult, Iterable, Order, QueryOrder, QuerySelect, SelectColumns};
|
use sea_orm::{entity::prelude::*, sea_query::IntoCondition, Condition, FromQueryResult, Iterable, Order, QueryOrder, QuerySelect, SelectColumns};
|
||||||
|
|
||||||
use crate::routes::activitypub::jsonld::LD;
|
use crate::routes::activitypub::jsonld::LD;
|
||||||
|
|
||||||
|
@ -169,9 +169,13 @@ impl Entity {
|
||||||
.order_by(Column::Published, Order::Desc);
|
.order_by(Column::Published, Order::Desc);
|
||||||
|
|
||||||
if let Some(uid) = uid {
|
if let Some(uid) = uid {
|
||||||
|
let uid = uid.to_string();
|
||||||
select = select
|
select = select
|
||||||
.filter(crate::model::like::Column::Actor.eq(uid))
|
.join(
|
||||||
.join(sea_orm::JoinType::LeftJoin, crate::model::object::Relation::Like.def())
|
sea_orm::JoinType::LeftJoin,
|
||||||
|
crate::model::object::Relation::Like.def()
|
||||||
|
.on_condition(move |_l, _r| crate::model::like::Column::Actor.eq(uid.clone()).into_condition()),
|
||||||
|
)
|
||||||
.select_column_as(crate::model::like::Column::Actor, format!("{}{}", crate::model::like::Entity.table_name(), crate::model::like::Column::Actor.to_string()));
|
.select_column_as(crate::model::like::Column::Actor, format!("{}{}", crate::model::like::Entity.table_name(), crate::model::like::Column::Actor.to_string()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue