From a809700ec2e8b83c315aa73b9a64c1395ef6ec50 Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Thu, 27 Oct 2022 15:10:22 +0100 Subject: [PATCH] Throw 400 when validation fails --- packages/server/src/api/controllers/row/internal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/api/controllers/row/internal.js b/packages/server/src/api/controllers/row/internal.js index e59d2cb38f..52f8a548fe 100644 --- a/packages/server/src/api/controllers/row/internal.js +++ b/packages/server/src/api/controllers/row/internal.js @@ -118,7 +118,7 @@ exports.patch = async ctx => { }) if (!validateResult.valid) { - throw { validation: validateResult.errors } + ctx.throw(400, { validation: validateResult.errors }) } // returned row is cleaned and prepared for writing to DB