mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Custom validations for settings
This commit is contained in:
parent
3123547e55
commit
60020734d5
@ -101,7 +101,7 @@ class Handler extends ExceptionHandler
|
|||||||
else if($exception instanceof MethodNotAllowedHttpException){
|
else if($exception instanceof MethodNotAllowedHttpException){
|
||||||
return response()->json(['message'=>'Method not support for this route'],404);
|
return response()->json(['message'=>'Method not support for this route'],404);
|
||||||
}
|
}
|
||||||
else if ($exception instanceof ValidationException) {
|
else if ($exception instanceof ValidationException && $request->expectsJson()) {
|
||||||
return response()->json(['message' => 'The given data was invalid.', 'errors' => $exception->validator->getMessageBag()], 422);
|
return response()->json(['message' => 'The given data was invalid.', 'errors' => $exception->validator->getMessageBag()], 422);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user