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

Merge pull request #6406 from turbo124/v5-develop

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

View File

@ -270,6 +270,7 @@ class PreviewController extends BaseController
DB::connection(config('database.default'))->rollBack();
if (request()->query('html') == 'true') {
DB::purge(config('database.default'));
return $maker->getCompiledHTML;
}
@ -278,6 +279,8 @@ class PreviewController extends BaseController
catch(\Exception $e){
DB::connection(config('database.default'))->rollBack();
DB::purge(config('database.default'));
return;
}
@ -301,6 +304,7 @@ class PreviewController extends BaseController
->batch();
}
DB::purge(config('database.default'));
$response = Response::make($file_path, 200);
$response->header('Content-Type', 'application/pdf');