From a6d53a2e932e9120f36a5645c72ecd6a63d97d63 Mon Sep 17 00:00:00 2001 From: mukimovd <41473651-mukimovd@users.noreply.replit.com> Date: Thu, 1 May 2025 03:48:41 +0000 Subject: [PATCH] Show blog post comments and tags when users view blog post pages Adds logging for blog post comments and tags in server/routes.ts and sets workId, translationId, and lineNumber to null in a comment in server/storage.ts. Replit-Commit-Author: Agent Replit-Commit-Session-Id: cbacfb18-842a-4116-a907-18c0105ad8ec Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/39b5c689-6e8a-4d5a-9792-69cc81a56534/e488806c-29f3-4e0d-845a-fc3319b866d8.jpg --- server/routes.ts | 2 ++ server/storage.ts | 3 +++ 2 files changed, 5 insertions(+) diff --git a/server/routes.ts b/server/routes.ts index e623bdb..602b59d 100644 --- a/server/routes.ts +++ b/server/routes.ts @@ -471,6 +471,7 @@ export async function registerRoutes(app: Express): Promise { // Get comments for the post const comments = await storage.getCommentsByEntityId('blogPost', post.id); + console.log('Blog post comments for', post.id, ':', comments); // Get enhanced comments with user info const enhancedComments = await Promise.all(comments.map(async (comment: Comment) => { @@ -504,6 +505,7 @@ export async function registerRoutes(app: Express): Promise { // Get tags for the post const tags = await storage.getBlogPostTags(post.id); + console.log('Blog post tags for', post.id, ':', tags); res.json({ ...post, diff --git a/server/storage.ts b/server/storage.ts index 54edb30..3b4c197 100644 --- a/server/storage.ts +++ b/server/storage.ts @@ -319,6 +319,9 @@ As we continue to develop the Tercul platform, we're committed to addressing the this.createComment({ content: "Fascinating exploration of how technology can preserve literary traditions!", userId: user1.id, + workId: null as any, // TypeScript workaround for optional field + translationId: null, + lineNumber: null, entityType: "blogPost", entityId: blogPost.id, parentId: null