Verified Commit 43fe3a45 authored by les's avatar les
Browse files

add small validation on event

parent 94db206c
......@@ -264,7 +264,7 @@ const eventController = {
async add (req, res) {
// req.err comes from multer streaming error
if (req.err) {
log.info(req.err)
log.warn(req.err)
return res.status(400).json(req.err.toString())
}
......@@ -272,6 +272,11 @@ const eventController = {
const body = req.body
const recurrent = body.recurrent ? JSON.parse(body.recurrent) : null
if (!body.place_name) {
log.warn('Place is required')
return res.status(400).send('Place is required')
}
const eventDetails = {
title: body.title,
// remove html tags
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment