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

Merge pull request #6404 from turbo124/v5-develop

Fixes for preview
This commit is contained in:
David Bomba 2021-08-05 22:52:07 +10:00 committed by GitHub
commit 9d568de394
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -204,16 +204,13 @@ class PreviewController extends BaseController
if($request->has('entity_id')){
$entity_obj = $class::on($company->db)
->where('id', $this->decodePrimaryKey($request->input('entity_id')))
$entity_obj = $class::where('id', $this->decodePrimaryKey($request->input('entity_id')))
->where('company_id', $company->id)
->withTrashed()
->first();
if($entity_obj)
info("found a valid entity object");
else
$entity_obj = $factory;
$entity_obj = $repo->save($request->all(), $entity_obj);