contact.js 277 B

1234567891011
  1. const Joi = require('joi');
  2. const validate = require('./validate');
  3. const schemaCreateContact = Joi.object({
  4. number: Joi.string().min(8).max(14).required(),
  5. });
  6. module.exports.createContact = (req, _res, next) => {
  7. return validate(schemaCreateContact, req.body, next);
  8. };