Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adding thread to the comment module #1341

Open
wants to merge 13 commits into
base: dev
Choose a base branch
from

Conversation

canonone
Copy link

@canonone canonone commented Mar 1, 2025

The current comment module in the NestJS codebase supports only flat comments, lacking the ability to create threaded (nested) replies. This limits discussion clarity and prevents admins from directly responding to specific user comments for follow-up or clarification. We’re adding a threading feature to enable hierarchical comments, allowing replies to be linked to parent comments via a parentId field, with a new GET /comments/:id/thread endpoint to retrieve nested comment structures. This requires both application code updates and a PostgreSQL schema change to add a parent_id column.
here is the link to the full issue description: #1328

canonone and others added 6 commits March 1, 2025 14:23
…reading

- Added `parentId` field to `CreateCommentDto` to allow specifying a parent comment for replies.\n- Applied `@IsUUID('4')` and `@IsOptional()` validations for PostgreSQL UUID compatibility and flexibility.\n- Updated Swagger `@ApiProperty` to document the new field as optional.
- Introduced `getCommentThread` endpoint to retrieve a comment and its nested replies.\n- Added Swagger documentation with `@ApiOperation` and `@ApiResponse` for clarity.\n- Integrates with `CommentsService.getCommentThread` to expose threading functionality via the API.
- Updated `addComment` to handle `parentId`, linking replies to parent comments via the `parent` relation.\n- Added `getCommentThread` method to fetch a comment with its nested replies and user details.\n- Both methods depend on the `parent_id` column in PostgreSQL; will fail without DB migration.
@canonone canonone changed the title Canonone/feat/adding thread to the comment module feat/adding thread to the comment module Mar 1, 2025
@canonone canonone changed the title feat/adding thread to the comment module feat: adding thread to the comment module Mar 1, 2025
canonone and others added 7 commits March 2, 2025 14:54
Merged threading feature with delete and dislike features from dev branch. Added  endpoint and method alongside  and . Updated Comment entity with both threading (, ) and dislike (, ) fields.
…module

Integrated updates from the remote branch to resolve a non-fast-forward push error. This merge ensures the local branch includes the latest remote state while preserving the threading feature and resolved conflicts with the delete/dislike features from dev.
…module

Integrated updates from the remote branch to resolve a non-fast-forward push error. This merge ensures the local branch includes the latest remote state while preserving the threading feature and resolved conflicts with the delete/dislike features from dev.
…module

Integrated updates from the remote branch to resolve a non-fast-forward push error. This merge ensures the local branch includes the latest remote state while preserving the threading feature and resolved conflicts with the delete/dislike features from dev.
…module

Integrated updates from the remote branch to resolve a non-fast-forward push error. This merge ensures the local branch includes the latest remote state while preserving the threading feature and resolved conflicts with the delete/dislike features from dev.
…module

Integrated updates from the remote branch to resolve a non-fast-forward push error. This merge ensures the local branch includes the latest remote state while preserving the threading feature and resolved conflicts with the delete/dislike features from dev.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant