diff --git a/app/Classes/Modules/Companies/ControllersLogic/BulkDownloadCustomerInvoicesLogic.php b/app/Classes/Modules/Companies/ControllersLogic/BulkDownloadCustomerInvoicesLogic.php index d8c3506d..dd48425c 100644 --- a/app/Classes/Modules/Companies/ControllersLogic/BulkDownloadCustomerInvoicesLogic.php +++ b/app/Classes/Modules/Companies/ControllersLogic/BulkDownloadCustomerInvoicesLogic.php @@ -75,7 +75,18 @@ class BulkDownloadCustomerInvoicesLogic } $zip->close(); - return response()->download($zip_file); + $filePathForS3 = 'bulk_whiteform/'.$zipFileName; + Storage::disk('s3')->put($filePathForS3, file_get_contents($zip_file)); + + Log::info('BulkDownloadCustomerInvoicesLogic finished processing files count: '.count($invoicebookings)); + + $temporaryUrl = Storage::disk('s3')->temporaryUrl( + $filePathForS3, + Carbon::now()->addMinutes(10) + ); + + return response(['src' => $temporaryUrl ]); + } else { return response()->json([ 'status' => 'Error', diff --git a/app/Classes/Modules/Companies/ControllersLogic/BulkDownloadSupplierWhiteFormsLogic.php b/app/Classes/Modules/Companies/ControllersLogic/BulkDownloadSupplierWhiteFormsLogic.php index 6708646b..61c91d9b 100644 --- a/app/Classes/Modules/Companies/ControllersLogic/BulkDownloadSupplierWhiteFormsLogic.php +++ b/app/Classes/Modules/Companies/ControllersLogic/BulkDownloadSupplierWhiteFormsLogic.php @@ -75,7 +75,7 @@ class BulkDownloadSupplierWhiteFormsLogic $temporaryUrl = Storage::disk('s3')->temporaryUrl( $filePathForS3, - Carbon::now()->addMinutes(60) + Carbon::now()->addMinutes(10) ); return response(['src' => $temporaryUrl ]); diff --git a/resources/assets/vue/components/bookings/elements/DownloadSupplierWhiteFormComponent.vue b/resources/assets/vue/components/bookings/elements/DownloadSupplierWhiteFormComponent.vue index ef18c6a9..54f1617e 100644 --- a/resources/assets/vue/components/bookings/elements/DownloadSupplierWhiteFormComponent.vue +++ b/resources/assets/vue/components/bookings/elements/DownloadSupplierWhiteFormComponent.vue @@ -94,9 +94,8 @@ export default { this.returnData = null; if(window.LARAVEL_VAPOR_ENABLED){ console.log('window.LARAVEL_VAPOR_ENABLED'); - let src = response.src; - if (src) { - window.location.href = src; + if (response.src) { + window.location.href = response.src; } } } diff --git a/resources/assets/vue/components/companies/elements/BulkDownloadInvoiceComponent.vue b/resources/assets/vue/components/companies/elements/BulkDownloadInvoiceComponent.vue index deff567e..b8b50998 100644 --- a/resources/assets/vue/components/companies/elements/BulkDownloadInvoiceComponent.vue +++ b/resources/assets/vue/components/companies/elements/BulkDownloadInvoiceComponent.vue @@ -88,15 +88,17 @@ }, successHandler(response) { this.isLoading = false; - if(window.LARAVEL_VAPOR_ENABLED){ - let src = response.payload.src; - window.location.href = src; + console.log('debug response: ' + JSON.stringify(response)); + if (response.message) { + this.returnData = response; } - else{ - if (response.message) { - this.returnData = response; - } else { - this.returnData = null; + else { + this.returnData = null; + if(window.LARAVEL_VAPOR_ENABLED){ + console.log('window.LARAVEL_VAPOR_ENABLED'); + if (response.src) { + window.location.href = response.src; + } } } },