Change validation failure to 422 to make it consistent with Laravel's default

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2021-12-08 17:54:35 -08:00
parent 8fa690b635
commit 81b66d0039

View file

@ -121,6 +121,6 @@ class Handler extends ExceptionHandler
*/ */
protected function invalidJson($request, ValidationException $exception) 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));
} }
} }