fix: tag feed returns full FeedEntry with author and counts
Some checks failed
lint / lint (push) Has been cancelled
test / unit (push) Has been cancelled
test / integration (push) Has been cancelled
lint / lint (pull_request) Failing after 5m2s
test / unit (pull_request) Successful in 16m3s
test / integration (pull_request) Failing after 16m59s

This commit is contained in:
2026-05-14 15:43:02 +02:00
parent 38b4774a63
commit cc9658975f
5 changed files with 44 additions and 15 deletions

View File

@@ -2,10 +2,9 @@ use domain::{
errors::DomainError,
models::{
feed::{FeedEntry, PageParams, Paginated, UserSummary},
thought::Thought,
user::User,
},
ports::{FeedRepository, FollowRepository, TagRepository, ThoughtRepository, UserRepository},
ports::{FeedRepository, FollowRepository, ThoughtRepository, UserRepository},
value_objects::UserId,
};
@@ -30,8 +29,8 @@ pub async fn get_following(follows: &dyn FollowRepository, user_id: &UserId, pag
follows.list_following(user_id, &page).await
}
pub async fn get_by_tag(tags: &dyn TagRepository, tag_name: &str, page: PageParams) -> Result<Paginated<Thought>, DomainError> {
tags.list_thoughts_by_tag(tag_name, &page).await
pub async fn get_by_tag(feed: &dyn FeedRepository, tag_name: &str, page: PageParams) -> Result<Paginated<FeedEntry>, DomainError> {
feed.tag_feed(tag_name, &page, None).await
}
pub async fn search(feed: &dyn FeedRepository, query: &str, page: PageParams, viewer_id: Option<&UserId>) -> Result<Paginated<FeedEntry>, DomainError> {