mirror of
https://github.com/SamyRai/tercul-frontend.git
synced 2025-12-27 03:41:34 +00:00
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
This commit is contained in:
parent
3cb048ea9e
commit
a6d53a2e93
@ -471,6 +471,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
|||||||
|
|
||||||
// Get comments for the post
|
// Get comments for the post
|
||||||
const comments = await storage.getCommentsByEntityId('blogPost', post.id);
|
const comments = await storage.getCommentsByEntityId('blogPost', post.id);
|
||||||
|
console.log('Blog post comments for', post.id, ':', comments);
|
||||||
|
|
||||||
// Get enhanced comments with user info
|
// Get enhanced comments with user info
|
||||||
const enhancedComments = await Promise.all(comments.map(async (comment: Comment) => {
|
const enhancedComments = await Promise.all(comments.map(async (comment: Comment) => {
|
||||||
@ -504,6 +505,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
|||||||
|
|
||||||
// Get tags for the post
|
// Get tags for the post
|
||||||
const tags = await storage.getBlogPostTags(post.id);
|
const tags = await storage.getBlogPostTags(post.id);
|
||||||
|
console.log('Blog post tags for', post.id, ':', tags);
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
...post,
|
...post,
|
||||||
|
|||||||
@ -319,6 +319,9 @@ As we continue to develop the Tercul platform, we're committed to addressing the
|
|||||||
this.createComment({
|
this.createComment({
|
||||||
content: "Fascinating exploration of how technology can preserve literary traditions!",
|
content: "Fascinating exploration of how technology can preserve literary traditions!",
|
||||||
userId: user1.id,
|
userId: user1.id,
|
||||||
|
workId: null as any, // TypeScript workaround for optional field
|
||||||
|
translationId: null,
|
||||||
|
lineNumber: null,
|
||||||
entityType: "blogPost",
|
entityType: "blogPost",
|
||||||
entityId: blogPost.id,
|
entityId: blogPost.id,
|
||||||
parentId: null
|
parentId: null
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user