feat(backend): wire FeedRequest/FeedOptions sort+filter through all feed layers

This commit is contained in:
2026-05-28 23:45:46 +02:00
parent 95728302b7
commit 0688ffe0ae
6 changed files with 197 additions and 86 deletions

View File

@@ -1,7 +1,7 @@
use domain::{
errors::DomainError,
models::feed::{FeedEntry, PageParams, Paginated},
ports::{FeedQuery, FeedRepository, FollowRepository},
ports::{FeedOptions, FeedQuery, FeedRepository, FeedRequest, FollowRepository},
value_objects::UserId,
};
@@ -10,9 +10,13 @@ pub async fn get_home_feed(
follows: &dyn FollowRepository,
user_id: &UserId,
page: PageParams,
opts: FeedOptions,
) -> Result<Paginated<FeedEntry>, DomainError> {
let mut following_ids = follows.get_accepted_following_ids(user_id).await?;
following_ids.push(user_id.clone());
feed.query(&FeedQuery::home(user_id.clone(), following_ids, page))
.await
feed.query(&FeedRequest {
query: FeedQuery::home(user_id.clone(), following_ids, page),
options: opts,
})
.await
}