{"size": 469, "ext": "js", "max_stars_repo_path": "src/components/todo/todo.middleware.js", "max_stars_repo_name": "mikesavvakisnet/express-node-boilerplate", "max_stars_repo_stars_event_min_datetime": "2020-07-13T19:14:02.000Z", "max_stars_repo_stars_event_max_datetime": "2020-11-10T19:27:51.000Z", "max_issues_repo_path": "src/components/todo/todo.middleware.js", "max_issues_repo_name": "mikesavvakisnet/express-node-boilerplate", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/components/todo/todo.middleware.js", "max_forks_repo_name": "mikesavvakisnet/express-node-boilerplate", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 4, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 27.5882352941, "max_line_length": 75, "alphanum_fraction": 0.7164179104}
const { ErrorHandler } = require('../../helpers/errorManagement');

const todoValidator = require('./todo.validator');

const validateCreateNewTodoRequest = (req, res, next) => {
  if (!todoValidator.validateCreateNewTodoRequest(req.body)) {
    // TODO: Move static string to specific file with multilanguage support
    return next(new ErrorHandler(400, 'Your request body is wrong.'));
  }

  return next();
};

module.exports = {
  validateCreateNewTodoRequest,
};
