From fad9474b00921223de4b14a785c90a1368896a8b Mon Sep 17 00:00:00 2001 From: Pranav C Date: Fri, 3 Mar 2023 10:50:20 +0530 Subject: [PATCH] fix: on ajv validation fail throw 400 bad request Signed-off-by: Pranav C --- packages/nocodb/src/lib/meta/helpers/catchError.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nocodb/src/lib/meta/helpers/catchError.ts b/packages/nocodb/src/lib/meta/helpers/catchError.ts index f7d6f9dd4b..4c6da5d46d 100644 --- a/packages/nocodb/src/lib/meta/helpers/catchError.ts +++ b/packages/nocodb/src/lib/meta/helpers/catchError.ts @@ -412,7 +412,7 @@ export default function ( } else if (e instanceof NotImplemented) { return res.status(501).json({ msg: e.message }); } else if (e instanceof AjvError) { - return res.status(501).json({ msg: e.message, errors: e.errors }); + return res.status(400).json({ msg: e.message, errors: e.errors }); } next(e); }