-
Notifications
You must be signed in to change notification settings - Fork 192
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
canonone
wants to merge
13
commits into
hngprojects:dev
Choose a base branch
from
canonone:canonone/feat/adding-thread-to-the-comment-module
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: adding thread to the comment module #1341
canonone
wants to merge
13
commits into
hngprojects:dev
from
canonone:canonone/feat/adding-thread-to-the-comment-module
+72
−19
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…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.
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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