fix: list_mutual sort by follow created_at, apply pagination in TestStore

This commit is contained in:
2026-05-28 03:40:44 +02:00
parent a6a555e6a7
commit 14b7928026
2 changed files with 29 additions and 14 deletions

View File

@@ -475,12 +475,18 @@ impl FollowRepository for TestStore {
following_ids.intersection(&follower_ids).cloned().collect();
drop(follows);
let users = self.users.lock().unwrap();
let items: Vec<User> = users
let all_items: Vec<User> = users
.iter()
.filter(|u| mutual_ids.contains(&u.id))
.cloned()
.collect();
let total = items.len() as i64;
let total = all_items.len() as i64;
let offset = page.offset() as usize;
let items: Vec<User> = all_items
.into_iter()
.skip(offset)
.take(page.limit() as usize)
.collect();
Ok(Paginated {
items,
total,