From 0ec839f42f4427d6095d04dc98644c0ae767a12a Mon Sep 17 00:00:00 2001 From: alemi Date: Thu, 28 Mar 2024 05:19:13 +0100 Subject: [PATCH] fix: followers was wrong because full model --- src/activitypub/user/following.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/activitypub/user/following.rs b/src/activitypub/user/following.rs index c09ee6e6..35d6b6e5 100644 --- a/src/activitypub/user/following.rs +++ b/src/activitypub/user/following.rs @@ -34,9 +34,11 @@ pub async fn page( let offset = page.offset.unwrap_or(0); match model::relation::Entity::find() .filter(Condition::all().add(if OUTGOING { Follower } else { Following }.eq(ctx.uid(id.clone())))) + .select_only() .select_column(if OUTGOING { Following } else { Follower }) .limit(limit) .offset(page.offset.unwrap_or(0)) + .into_tuple::() .all(ctx.db()).await { Err(e) => { @@ -49,7 +51,7 @@ pub async fn page( &url!(ctx, "/users/{id}/{follow___}"), offset, limit, - following.into_iter().map(|x| Node::link(x.following)).collect() + following.into_iter().map(Node::link).collect() ).ld_context() )) },