From 50bfaff62bf7e0d1cec9b89c1470f65c61ed26c2 Mon Sep 17 00:00:00 2001 From: ddadaal Date: Thu, 30 Sep 2021 10:43:34 +0800 Subject: [PATCH] fix(route): show complete error messages for param validation --- src/route/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/route/index.ts b/src/route/index.ts index 115b13a..06bebdb 100644 --- a/src/route/index.ts +++ b/src/route/index.ts @@ -15,7 +15,7 @@ function reportError( res: NextApiResponse, part: "QUERY" | "BODY", errors?: ErrorObject[] | null) { res.status(400).json({ code: part + "_VALIDATION_ERROR", - messages: errors?.map((x) => x.message), + errors, }); }