Closed saymondamasio closed 3 years ago
add file types, to validate the multipart/form-data that the multer creates
example:
const upload = multer(uploadConfig) routes.post( '/orphanages', upload.array('images'), (req, res, next) => { console.log(req.files) return next() }, celebrate({ [Segments.BODY]: { name: Joi.string().required(), latitude: Joi.number().required(), longitude: Joi.number().required(), about: Joi.string().required().max(300), instructions: Joi.string().required(), opening_hours: Joi.string().required(), open_on_weekends: Joi.boolean().required(), }, [Segments.FILES]: Joi.array().items({ path: Joi.string().required(), }), }), new OrphanagesController().create, )
This isn't implemented yet? How did you resolve it? @saymondamasio
add file types, to validate the multipart/form-data that the multer creates
example: