return on errors

parent 3e5f0393
......@@ -69,6 +69,7 @@ module.exports = (app, db) => {
const val = req.body[field]
if (!val || val.trim() == '') {
errors.push(sprintf("Field %s is required", field))
return
}
post[field] = val.trim()
......
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