Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
les
gancio
Commits
43fe3a45
Verified
Commit
43fe3a45
authored
Jul 04, 2021
by
les
Browse files
add small validation on event
parent
94db206c
Changes
1
Hide whitespace changes
Inline
Side-by-side
server/api/controller/event.js
View file @
43fe3a45
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment