-
Notifications
You must be signed in to change notification settings - Fork 0
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: Implement Task Commenting Feature #1
base: main
Are you sure you want to change the base?
Conversation
PR Update: Implementations Based on FeedbackI have refactored both the backend and frontend code for the commenting feature as per the feedback provided. Below are the changes made: Backend
Frontend
These changes ensure proper integration between the frontend and backend while adhering to the feedback provided. The code has been tested to confirm that it works as expected. Please review the updates and let me know if there are any further changes required. |
task: comment.task, | ||
account: | ||
typeof comment.account === 'string' | ||
? { id: comment.account } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if an account is a string then just do comment. account no need for an id field inside the object.
this.comment = comment; | ||
this.createdAt = createdAt; | ||
this.updatedAt = updatedAt; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we need this constructor?
} | ||
|
||
private static convertAccount( | ||
account: Types.ObjectId | Account, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
convertPopulatedAccountDBToAccount(
account: Types.ObjectId | Account,
): string | Account
Write automated test cases |
Pull Request for Task Commenting Feature
Description
This PR introduces the task commenting feature to our application. Users can now add, edit, delete, and view comments on tasks. The implementation includes both backend and frontend changes to support this functionality.
Why is this change needed?
This change is necessary to allow users to communicate and collaborate on tasks by adding comments. It enhances the task management system by enabling better communication and feedback.
Changes Overview
Backend
New Endpoints:
POST /comments
: Create a new comment for a task.GET /comments/:taskId
: Fetch all comments for a specific task.PUT /comments/:commentId
: Update a specific comment.DELETE /comments/:commentId
: Delete a specific comment.Database Models:
Controllers:
Services:
Utils:
Frontend
Components:
Context:
Services:
Types:
API Changes
POST /comments
GET /comments/:taskId
PUT /comments/:commentId
DELETE /comments/:commentId
Database Schema Changes
No changes were made to the existing database schema. The new
CommentDB
schema was added to support comments.Tests
Automated Test Cases Added: (Yet to add)
Manual Test Cases Run:
Meta Information
Self Review
This PR has been self-reviewed to ensure quality and consistency.
Thank you for reviewing this PR.