diff --git a/app/Http/Middleware/CheckForStorageInvoiceByOrderId.php b/app/Http/Middleware/CheckForStorageInvoiceByOrderId.php index 5765a284..c576da51 100644 --- a/app/Http/Middleware/CheckForStorageInvoiceByOrderId.php +++ b/app/Http/Middleware/CheckForStorageInvoiceByOrderId.php @@ -29,7 +29,12 @@ class CheckForStorageInvoiceByOrderId public function handle(Request $request, Closure $next) { $orderId = $request->route('id'); - $storages = $this->storageInvoiceTransactionProcessor->execute($orderId); + $storages = []; + try{ + $storages = $this->storageInvoiceTransactionProcessor->execute($orderId); + } catch (\Exception $exception) { + $storages = []; + } $request->merge(['storages' => $storages]); return $next($request); } diff --git a/resources/assets/vue/components/orders/sections/OrderProfileV2SectionComponent.vue b/resources/assets/vue/components/orders/sections/OrderProfileV2SectionComponent.vue index fd3276bd..de183861 100644 --- a/resources/assets/vue/components/orders/sections/OrderProfileV2SectionComponent.vue +++ b/resources/assets/vue/components/orders/sections/OrderProfileV2SectionComponent.vue @@ -215,6 +215,11 @@ this.isLoading = false; this.order = response.payload.data; }, + errorHandler(error, status){ + if(status == 404){ + window.location.href = this.route('error.404'); + } + }, getStorageInfo(invoice) { const storageObject = this.findStorageInfoObject(invoice.id); return storageObject;