Skip to content

Commit

Permalink
fix(route): show complete error messages for param validation
Browse files Browse the repository at this point in the history
  • Loading branch information
ddadaal committed Sep 30, 2021
1 parent f99c62a commit 50bfaff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/route/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
}

Expand Down

0 comments on commit 50bfaff

Please sign in to comment.