From 3725097749a836da77fbb5e7dc8319c479b3fa27 Mon Sep 17 00:00:00 2001 From: alemi Date: Thu, 28 Mar 2024 05:14:50 +0100 Subject: [PATCH] fix: followers querying with full id --- src/activitypub/user/following.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/activitypub/user/following.rs b/src/activitypub/user/following.rs index 6cdaa03..c09ee6e 100644 --- a/src/activitypub/user/following.rs +++ b/src/activitypub/user/following.rs @@ -11,7 +11,7 @@ pub async fn get( ) -> Result, StatusCode> { let follow___ = if OUTGOING { "following" } else { "followers" }; let count = model::relation::Entity::find() - .filter(Condition::all().add(if OUTGOING { Follower } else { Following }.eq(id.clone()))) + .filter(Condition::all().add(if OUTGOING { Follower } else { Following }.eq(ctx.uid(id.clone())))) .count(ctx.db()).await.unwrap_or_else(|e| { tracing::error!("failed counting {follow___} for {id}: {e}"); 0 @@ -33,7 +33,7 @@ pub async fn page( let limit = page.batch.unwrap_or(20).min(50); let offset = page.offset.unwrap_or(0); match model::relation::Entity::find() - .filter(Condition::all().add(if OUTGOING { Follower } else { Following }.eq(id.clone()))) + .filter(Condition::all().add(if OUTGOING { Follower } else { Following }.eq(ctx.uid(id.clone())))) .select_column(if OUTGOING { Following } else { Follower }) .limit(limit) .offset(page.offset.unwrap_or(0))