mirror of
https://framagit.org/les/gancio.git
synced 2025-02-01 00:52:01 +01:00
add small validation on event
This commit is contained in:
parent
94db206c2c
commit
43fe3a45e8
1 changed files with 6 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue