From 81b66d003973e67d53d316a065ad9770dcb39d50 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 8 Dec 2021 17:54:35 -0800 Subject: [PATCH] Change validation failure to 422 to make it consistent with Laravel's default Signed-off-by: snipe --- app/Exceptions/Handler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index de890d3e4..7fd552f57 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -121,6 +121,6 @@ class Handler extends ExceptionHandler */ protected function invalidJson($request, ValidationException $exception) { - return response()->json(Helper::formatStandardApiResponse('error', null, $exception->errors(), 400)); + return response()->json(Helper::formatStandardApiResponse('error', null, $exception->errors(), 422)); } }