diff --git a/server/storage.ts b/server/storage.ts index 3b4c197..f52b7eb 100644 --- a/server/storage.ts +++ b/server/storage.ts @@ -312,10 +312,12 @@ As we continue to develop the Tercul platform, we're committed to addressing the }); // Add tags to the blog post + console.log('Adding tags to blog post', blogPost.id); this.addTagToBlogPost(blogPost.id, poetryTag.id); this.addTagToBlogPost(blogPost.id, romanticismTag.id); // Add a comment to the blog post + console.log('Creating comment for blog post', blogPost.id); this.createComment({ content: "Fascinating exploration of how technology can preserve literary traditions!", userId: user1.id, @@ -541,6 +543,8 @@ As we continue to develop the Tercul platform, we're committed to addressing the } async getCommentsByEntityId(entityType: string, entityId: number): Promise { + console.log(`Looking for comments with entityType=${entityType} and entityId=${entityId}`); + // If we're using the primary entity fields (workId or translationId) if (entityType === 'work') { return this.getCommentsByWorkId(entityId); @@ -548,11 +552,14 @@ As we continue to develop the Tercul platform, we're committed to addressing the return this.getCommentsByTranslationId(entityId); } else { // For all other entity types, use the generic entityType and entityId fields - return Array.from(this.comments.values()).filter( + const comments = Array.from(this.comments.values()).filter( comment => comment.entityType === entityType && comment.entityId === entityId ); + + console.log(`Found ${comments.length} comments for ${entityType}:${entityId}`, comments); + return comments; } }