chat.js 458 B

1234567891011121314151617
  1. const Joi = require('joi');
  2. const validate = require('./validate');
  3. const schemaStartChat = Joi.object({
  4. id: Joi.string().required(),
  5. });
  6. const schemaTypingChat = Joi.object({
  7. id: Joi.string().required(),
  8. typing: Joi.boolean().required(),
  9. });
  10. module.exports.startChat = (req, _res, next) => {
  11. return validate(schemaStartChat, req.body, next);
  12. };
  13. module.exports.typingChat = (req, _res, next) => {
  14. return validate(schemaTypingChat, req.body, next);
  15. };