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

Fix/Todo-list #189

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/controllers/apps/todo/todo.controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const toggleTodoDoneStatus = asyncHandler(async (req, res) => {
new ApiResponse(
200,
todo,
"Todo marked " + todo.isComplete ? "done" : "undone"
"Todo marked " + `${todo.isComplete ? "done" : "undone"}`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original code has an issue with string concatenation logic. The condition should be evaluated correctly within the string interpolation.
Improvement: The use of string interpolation directly inside the template literal ensures clarity and correctness.

)
);
});
Expand Down
11 changes: 3 additions & 8 deletions src/validators/apps/todo/todo.validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const createTodoValidator = () => {
.optional()
.trim()
.notEmpty()
.withMessage("Todo title is required"),
.withMessage("Todo description is required"),
];
};

Expand All @@ -34,13 +34,8 @@ const updateTodoValidator = () => {
.optional()
.trim()
.notEmpty()
.withMessage("Todo title is required"),
.withMessage("Todo description is required"),
];
};


export {
createTodoValidator,
updateTodoValidator,
getAllTodosQueryValidators,
};
export { createTodoValidator, updateTodoValidator, getAllTodosQueryValidators };
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep the formatting as is for unchanged lines.