From e2b378e1975ca3449f10d0ef2da90544684fa41f Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Sun, 21 Jan 2024 22:48:48 +0800 Subject: [PATCH] Vue Polling - Solve a problem where query of packing list with contaienrs and packages data is taking too long to complete --- app/Http/Resources/ListPackingListJobResource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Resources/ListPackingListJobResource.php b/app/Http/Resources/ListPackingListJobResource.php index 1e6ad3aa..6b13be59 100644 --- a/app/Http/Resources/ListPackingListJobResource.php +++ b/app/Http/Resources/ListPackingListJobResource.php @@ -37,7 +37,7 @@ class ListPackingListJobResource extends JsonResource // 'order' => New OrderResource($this->owner) // ]), 'container' => new ContainerResource($this->containers->first()), - 'packages' => PackageWithoutOrderResource::collection($this->packages), + 'packages' => PackageWithoutOrderResource::collection($packages), $this->mergeWhen($this->owner instanceof Order, [ 'order' => New OrderResource($this->owner) ]), 'shipping_transaction' => new TransactionResource($this->transactions()->where('type', TransactionType::SHIPPING_INVOICE)->whereNotIn('status', [ApprovalStatus::SUSPENDED, ApprovalStatus::EXPIRED])->first()), 'suspended_invoice' => new TransactionResource($this->transactions()->where('type', TransactionType::SHIPPING_INVOICE)->whereIn('status', [ApprovalStatus::SUSPENDED])->first()),