From 478941c6fb3cddabff06705db33ce17cad204834 Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Thu, 20 Jun 2024 16:16:09 +0800 Subject: [PATCH] Export pdf file from Laravel Vapor through S3 bucket --- .../accounting/sections/ImportedInvoiceMappedComponent.vue | 3 ++- .../accounting/sections/ImportedReceiptMappedComponent.vue | 3 ++- .../accounting/sections/TransactionsMappingComponent.vue | 6 ++++-- .../elements/CustomerTransactionHistorySectionComponent.vue | 3 ++- .../bookings/elements/UploadDebtorExcelComponent.vue | 3 ++- .../bookings/forms/SupplierPlaceOrderFormComponent.vue | 2 -- .../wallets/elements/CustomerWalletTransactionComponent.vue | 3 ++- 7 files changed, 14 insertions(+), 9 deletions(-) diff --git a/resources/assets/vue/components/accounting/sections/ImportedInvoiceMappedComponent.vue b/resources/assets/vue/components/accounting/sections/ImportedInvoiceMappedComponent.vue index d861558d..a76464d7 100644 --- a/resources/assets/vue/components/accounting/sections/ImportedInvoiceMappedComponent.vue +++ b/resources/assets/vue/components/accounting/sections/ImportedInvoiceMappedComponent.vue @@ -131,7 +131,8 @@ return fetch(url, { method: 'GET', responseType: 'json', - }).then(response => { + }).then(response => response.json()) + .then(response => { if (response.src) { window.location.href = response.src; } diff --git a/resources/assets/vue/components/accounting/sections/ImportedReceiptMappedComponent.vue b/resources/assets/vue/components/accounting/sections/ImportedReceiptMappedComponent.vue index 12c38893..2dd7770b 100644 --- a/resources/assets/vue/components/accounting/sections/ImportedReceiptMappedComponent.vue +++ b/resources/assets/vue/components/accounting/sections/ImportedReceiptMappedComponent.vue @@ -135,7 +135,8 @@ return fetch(url, { method: 'GET', responseType: 'json', - }).then(response => { + }).then(response => response.json()) + .then(response => { if (response.src) { window.location.href = response.src; } diff --git a/resources/assets/vue/components/accounting/sections/TransactionsMappingComponent.vue b/resources/assets/vue/components/accounting/sections/TransactionsMappingComponent.vue index 69acc77c..65f5b0b1 100644 --- a/resources/assets/vue/components/accounting/sections/TransactionsMappingComponent.vue +++ b/resources/assets/vue/components/accounting/sections/TransactionsMappingComponent.vue @@ -277,7 +277,8 @@ export default { return fetch(route, { method: 'GET', responseType: 'json', - }).then(response => { + }).then(response => response.json()) + .then(response => { if (response.src) { window.location.href = response.src; } @@ -301,7 +302,8 @@ export default { return fetch(route, { method: 'GET', responseType: 'json', - }).then(response => { + }).then(response => response.json()) + .then(response => { if (response.src) { window.location.href = response.src; } diff --git a/resources/assets/vue/components/bookings/elements/CustomerTransactionHistorySectionComponent.vue b/resources/assets/vue/components/bookings/elements/CustomerTransactionHistorySectionComponent.vue index 7826998d..d238b2be 100644 --- a/resources/assets/vue/components/bookings/elements/CustomerTransactionHistorySectionComponent.vue +++ b/resources/assets/vue/components/bookings/elements/CustomerTransactionHistorySectionComponent.vue @@ -126,7 +126,8 @@ export default { return fetch(url, { method: 'GET', responseType: 'json', - }).then(response => { + }).then(response => response.json()) + .then(response => { if (response.src) { window.location.href = response.src; } diff --git a/resources/assets/vue/components/bookings/elements/UploadDebtorExcelComponent.vue b/resources/assets/vue/components/bookings/elements/UploadDebtorExcelComponent.vue index 5177cf38..cc53475b 100644 --- a/resources/assets/vue/components/bookings/elements/UploadDebtorExcelComponent.vue +++ b/resources/assets/vue/components/bookings/elements/UploadDebtorExcelComponent.vue @@ -77,7 +77,8 @@ return fetch(route, { method: 'GET', responseType: 'json', - }).then(response => { + }).then(response => response.json()) + .then(response => { if (response.src) { window.location.href = response.src; } diff --git a/resources/assets/vue/components/bookings/forms/SupplierPlaceOrderFormComponent.vue b/resources/assets/vue/components/bookings/forms/SupplierPlaceOrderFormComponent.vue index 91a59d60..2eed5c90 100644 --- a/resources/assets/vue/components/bookings/forms/SupplierPlaceOrderFormComponent.vue +++ b/resources/assets/vue/components/bookings/forms/SupplierPlaceOrderFormComponent.vue @@ -157,8 +157,6 @@ responseType: 'json', }).then(response => response.json()) .then(response => { - console.log('whiteForm.mockUp: ' + JSON.stringify(response)); - console.log('whiteForm.mockUp: ' + JSON.stringify(response.src)); if (response.src) { window.location.href = response.src; } diff --git a/resources/assets/vue/components/wallets/elements/CustomerWalletTransactionComponent.vue b/resources/assets/vue/components/wallets/elements/CustomerWalletTransactionComponent.vue index 5882610e..40e812bc 100644 --- a/resources/assets/vue/components/wallets/elements/CustomerWalletTransactionComponent.vue +++ b/resources/assets/vue/components/wallets/elements/CustomerWalletTransactionComponent.vue @@ -35,7 +35,8 @@ return fetch(url, { method: 'GET', responseType: 'json', - }).then(response => { + }).then(response => response.json()) + .then(response => { if (response.src) { window.location.href = response.src; }