mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Fixes for preview
This commit is contained in:
parent
564278a6c8
commit
1195838ded
@ -172,8 +172,9 @@ class PreviewController extends BaseController
|
||||
$company = auth()->user()->company();
|
||||
|
||||
MultiDB::setDb($company->db);
|
||||
|
||||
DB::connection($company->db)->reconnect();
|
||||
info("preview db = ".$company->db);
|
||||
info(config('database.connections.db-ninja-01.database'));
|
||||
|
||||
if($request->input('entity') == 'invoice'){
|
||||
$repo = new InvoiceRepository();
|
||||
@ -200,6 +201,7 @@ class PreviewController extends BaseController
|
||||
|
||||
try {
|
||||
|
||||
DB::connection(config('database.default'))->beginTransaction();
|
||||
|
||||
if($request->has('entity_id')){
|
||||
|
||||
@ -211,8 +213,6 @@ class PreviewController extends BaseController
|
||||
|
||||
}
|
||||
|
||||
DB::connection(config('database.default'))->beginTransaction();
|
||||
|
||||
$entity_obj = $repo->save($request->all(), $entity_obj);
|
||||
|
||||
$entity_obj->load('client');
|
||||
|
Loading…
x
Reference in New Issue
Block a user