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

@@ -161,21 +161,12 @@ pub async fn tag_thoughts_handler(
Query(q): Query<PaginationQuery>,
) -> Result<Json<serde_json::Value>, ApiError> {
let page = PageParams { page: q.page(), per_page: q.per_page() };
let result = get_by_tag(&*s.tags, &tag_name, page).await?;
let result = get_by_tag(&*s.feed, &tag_name, page).await?;
Ok(Json(serde_json::json!({
"tag": tag_name,
"total": result.total,
"page": result.page,
"per_page": result.per_page,
"items": result.items.iter().map(|t| serde_json::json!({
"id": t.id.as_uuid(),
"content": t.content.as_str(),
"in_reply_to_id": t.in_reply_to_id.as_ref().map(|id| id.as_uuid()),
"visibility": t.visibility.as_str(),
"content_warning": t.content_warning,
"sensitive": t.sensitive,
"created_at": t.created_at,
"updated_at": t.updated_at,
})).collect::<Vec<_>>()
"items": result.items.iter().map(to_thought_response).collect::<Vec<_>>(),
})))
}