mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-03 18:44:36 -04:00
Fixes for live preview
This commit is contained in:
parent
284203401b
commit
f644a2b460
@ -187,7 +187,7 @@ class Handler extends ExceptionHandler
|
|||||||
} elseif ($exception instanceof NotFoundHttpException && $request->expectsJson()) {
|
} elseif ($exception instanceof NotFoundHttpException && $request->expectsJson()) {
|
||||||
return response()->json(['message'=>'Route does not exist'], 404);
|
return response()->json(['message'=>'Route does not exist'], 404);
|
||||||
} elseif ($exception instanceof MethodNotAllowedHttpException && $request->expectsJson()) {
|
} 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()) {
|
} elseif ($exception instanceof ValidationException && $request->expectsJson()) {
|
||||||
nlog($exception->validator->getMessageBag());
|
nlog($exception->validator->getMessageBag());
|
||||||
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);
|
||||||
|
@ -191,7 +191,7 @@ class PreviewController extends BaseController
|
|||||||
|
|
||||||
if($request->has('entity_id')){
|
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);
|
$entity_obj = $repo->save($request->all(), $entity_obj);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user