fix: compute liked_by_viewer/boosted_by_viewer from DB — viewer_id was ignored in all feed queries

This commit is contained in:
2026-05-14 16:03:55 +02:00
parent 4890501512
commit ecba9267cf
3 changed files with 36 additions and 15 deletions

View File

@@ -158,10 +158,11 @@ pub async fn get_popular_tags(
pub async fn tag_thoughts_handler(
State(s): State<AppState>,
Path(tag_name): Path<String>,
OptionalAuthUser(viewer): OptionalAuthUser,
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.feed, &tag_name, page).await?;
let result = get_by_tag(&*s.feed, &tag_name, page, viewer.as_ref()).await?;
Ok(Json(serde_json::json!({
"tag": tag_name,
"total": result.total,