1
0
Fork 0
mirror of synced 2024-06-28 02:50:50 +12:00

Throw 400 when validation fails

This commit is contained in:
Mel O'Hagan 2022-10-27 15:10:22 +01:00
parent e8cd6facfd
commit e5b6a777da

View file

@ -118,7 +118,7 @@ exports.patch = async ctx => {
}) })
if (!validateResult.valid) { if (!validateResult.valid) {
throw { validation: validateResult.errors } ctx.throw(400, { validation: validateResult.errors })
} }
// returned row is cleaned and prepared for writing to DB // returned row is cleaned and prepared for writing to DB