diff --git a/app/routers/round_messages.py b/app/routers/round_messages.py index 6b3a2f3..d0312c1 100644 --- a/app/routers/round_messages.py +++ b/app/routers/round_messages.py @@ -639,6 +639,7 @@ class FeedEntryOut(BaseModel): created_at: str reactions: list[ReactionSummary] = [] comment_count: int = 0 + tags: list[TagOut] = [] @router.get("/feed", response_model=list[FeedEntryOut]) @@ -703,6 +704,7 @@ async def get_feed( entry_ids = [r["id"] for r in rows] reactions_by_id = await _round_message_reactions(conn, entry_ids, user.user_id) comment_counts = await _round_message_comment_counts(conn, entry_ids) + tags_by_id = await _tags_for_messages(conn, "round_message_tag", "round_message_id", entry_ids) return [ FeedEntryOut( id=r["id"], @@ -718,6 +720,7 @@ async def get_feed( created_at=r["created_at"].isoformat(), reactions=reactions_by_id.get(r["id"], []), comment_count=comment_counts.get(r["id"], 0), + tags=tags_by_id.get(r["id"], []), ) for r in rows ] diff --git a/frontend/components/feed.tsx b/frontend/components/feed.tsx index 14a46c6..2e5257d 100644 --- a/frontend/components/feed.tsx +++ b/frontend/components/feed.tsx @@ -5,6 +5,8 @@ import Link from "next/link" import { cn } from "@/lib/utils" import { PostEngagement, type ReactionSummary } from "./post-engagement" +import { TaggedText } from "./mention-input" +import type { Tag } from "@/lib/mentions" import { BottomNav } from "@/components/teecup/bottom-nav" /** Rå feed-oppføring fra backend. */ @@ -22,6 +24,7 @@ export type ApiFeedEntry = { created_at: string // ISO 8601 reactions: ReactionSummary[] comment_count: number + tags: Tag[] } const PAGE_SIZE = 20 @@ -232,13 +235,14 @@ function FeedCard({ entry, currentUserId }: { entry: ApiFeedEntry; currentUserId {/* Tekst */} {entry.body && (
- {entry.body}
+