From a908dbaa85dbe6b44d5b048c2055dfcd2df2ee40 Mon Sep 17 00:00:00 2001 From: vg04112001 Date: Tue, 20 Aug 2024 16:59:29 +0530 Subject: [PATCH] fix: correction in message inside validator and response message inside controller --- src/controllers/apps/todo/todo.controllers.js | 2 +- src/validators/apps/todo/todo.validators.js | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/controllers/apps/todo/todo.controllers.js b/src/controllers/apps/todo/todo.controllers.js index a123ad30..4207b2c8 100644 --- a/src/controllers/apps/todo/todo.controllers.js +++ b/src/controllers/apps/todo/todo.controllers.js @@ -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"}` ) ); }); diff --git a/src/validators/apps/todo/todo.validators.js b/src/validators/apps/todo/todo.validators.js index 0d16fbbc..621372fa 100644 --- a/src/validators/apps/todo/todo.validators.js +++ b/src/validators/apps/todo/todo.validators.js @@ -19,7 +19,7 @@ const createTodoValidator = () => { .optional() .trim() .notEmpty() - .withMessage("Todo title is required"), + .withMessage("Todo description is required"), ]; }; @@ -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 };