1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Merge pull request #6344 from turbo124/v5-develop

Fixes for live preview
This commit is contained in:
David Bomba 2021-07-27 22:20:57 +10:00 committed by GitHub
commit d6f2ce4bb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -187,7 +187,7 @@ class Handler extends ExceptionHandler
} elseif ($exception instanceof NotFoundHttpException && $request->expectsJson()) {
return response()->json(['message'=>'Route does not exist'], 404);
} elseif ($exception instanceof MethodNotAllowedHttpException && $request->expectsJson()) {
return response()->json(['message'=>'Method not support for this route'], 404);
return response()->json(['message'=>'Method not supported for this route'], 404);
} elseif ($exception instanceof ValidationException && $request->expectsJson()) {
nlog($exception->validator->getMessageBag());
return response()->json(['message' => 'The given data was invalid.', 'errors' => $exception->validator->getMessageBag()], 422);

View File

@ -191,7 +191,7 @@ class PreviewController extends BaseController
if($request->has('entity_id')){
$entity_obj = $class::whereId($this->decodePrimaryKey($request->input('entity_id')))->company()->first();
$entity_obj = $class::withTrashed()->whereId($this->decodePrimaryKey($request->input('entity_id')))->company()->first();
$entity_obj = $repo->save($request->all(), $entity_obj);
}