message.js 303 B

1234567891011
  1. const Joi = require('joi');
  2. const validate = require('./validate');
  3. const schemaSentMessage = Joi.object({
  4. id: Joi.string().required(),
  5. message: Joi.string().min(1).max(1400).required(),
  6. });
  7. module.exports.sentMessage = (req, _res, next) => {
  8. return validate(schemaSentMessage, req.body, next);
  9. };