mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 05:02:36 +01:00
Set Transactions on the correct database
This commit is contained in:
parent
79e56a4355
commit
0c9de66a80
@ -155,7 +155,7 @@ class PreviewController extends BaseController
|
||||
$t = app('translator');
|
||||
$t->replace(Ninja::transformTranslations(auth()->user()->company()->settings));
|
||||
|
||||
DB::beginTransaction();
|
||||
DB::connection(config('database.default'))->beginTransaction();
|
||||
|
||||
$client = Client::factory()->create([
|
||||
'user_id' => auth()->user()->id,
|
||||
@ -230,7 +230,7 @@ class PreviewController extends BaseController
|
||||
|
||||
$file_path = PreviewPdf::dispatchNow($maker->getCompiledHTML(true), auth()->user()->company());
|
||||
|
||||
DB::rollBack();
|
||||
DB::connection(config('database.default'))->rollBack();
|
||||
|
||||
$response = Response::make($file_path, 200);
|
||||
$response->header('Content-Type', 'application/pdf');
|
||||
|
@ -45,8 +45,8 @@ class SubscriptionRepository extends BaseRepository
|
||||
private function calculatePrice($subscription) :array
|
||||
{
|
||||
|
||||
DB::beginTransaction();
|
||||
|
||||
// DB::beginTransaction();
|
||||
DB::connection(config('database.default'))->beginTransaction();
|
||||
$data = [];
|
||||
|
||||
$client = Client::factory()->create([
|
||||
@ -90,8 +90,9 @@ class SubscriptionRepository extends BaseRepository
|
||||
|
||||
$data['promo_price'] = $invoice->calc()->getTotal();
|
||||
|
||||
DB::rollBack();
|
||||
|
||||
// DB::rollBack();
|
||||
DB::connection(config('database.default'))->rollBack();
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
@ -239,7 +239,7 @@ class TemplateEngine
|
||||
|
||||
private function mockEntity()
|
||||
{
|
||||
DB::beginTransaction();
|
||||
DB::connection(config('database.default'))->beginTransaction();
|
||||
|
||||
$client = Client::factory()->create([
|
||||
'user_id' => auth()->user()->id,
|
||||
@ -277,6 +277,6 @@ class TemplateEngine
|
||||
|
||||
private function tearDown()
|
||||
{
|
||||
DB::rollBack();
|
||||
DB::connection(config('database.default'))->rollBack();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user