add small validation on event
This commit is contained in:
@@ -264,7 +264,7 @@ const eventController = {
|
|||||||
async add (req, res) {
|
async add (req, res) {
|
||||||
// req.err comes from multer streaming error
|
// req.err comes from multer streaming error
|
||||||
if (req.err) {
|
if (req.err) {
|
||||||
log.info(req.err)
|
log.warn(req.err)
|
||||||
return res.status(400).json(req.err.toString())
|
return res.status(400).json(req.err.toString())
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -272,6 +272,11 @@ const eventController = {
|
|||||||
const body = req.body
|
const body = req.body
|
||||||
const recurrent = body.recurrent ? JSON.parse(body.recurrent) : null
|
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 = {
|
const eventDetails = {
|
||||||
title: body.title,
|
title: body.title,
|
||||||
// remove html tags
|
// remove html tags
|
||||||
|
|||||||
Reference in New Issue
Block a user