From dbf2450433f6126dcf22636786f0611b5fd16297 Mon Sep 17 00:00:00 2001 From: alemi Date: Wed, 1 May 2024 18:45:30 +0200 Subject: [PATCH] fix: select only user id column --- src/routes/activitypub/user/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/routes/activitypub/user/mod.rs b/src/routes/activitypub/user/mod.rs index 81085aed..127297f1 100644 --- a/src/routes/activitypub/user/mod.rs +++ b/src/routes/activitypub/user/mod.rs @@ -5,7 +5,7 @@ pub mod outbox; pub mod following; use axum::extract::{Path, Query, State}; -use sea_orm::{ColumnTrait, EntityTrait, QueryFilter, SelectColumns}; +use sea_orm::{ColumnTrait, EntityTrait, QueryFilter, QuerySelect, SelectColumns}; use apb::{ActorMut, CollectionMut, Node, Object, ObjectMut}; use crate::{errors::UpubError, model::{self, user}, server::{auth::AuthIdentity, fetcher::Fetcher, Context}, url}; @@ -46,6 +46,7 @@ pub async fn view( let followed_by_me = model::relation::Entity::find() .filter(model::relation::Column::Follower.eq(my_id)) .filter(model::relation::Column::Following.eq(&uid)) + .select_only() .select_column(model::relation::Column::Follower) .into_tuple::() .all(ctx.db()) @@ -58,6 +59,7 @@ pub async fn view( let following_me = model::relation::Entity::find() .filter(model::relation::Column::Following.eq(my_id)) .filter(model::relation::Column::Follower.eq(&uid)) + .select_only() .select_column(model::relation::Column::Following) .into_tuple::() .all(ctx.db()) @@ -90,6 +92,7 @@ pub async fn view( let followed_by_me = model::relation::Entity::find() .filter(model::relation::Column::Follower.eq(my_id)) .filter(model::relation::Column::Following.eq(&uid)) + .select_only() .select_column(model::relation::Column::Follower) .into_tuple::() .all(ctx.db()) @@ -102,6 +105,7 @@ pub async fn view( let following_me = model::relation::Entity::find() .filter(model::relation::Column::Following.eq(my_id)) .filter(model::relation::Column::Follower.eq(&uid)) + .select_only() .select_column(model::relation::Column::Following) .into_tuple::() .all(ctx.db())