diff --git a/app/Classes/Modules/PackingLists/ControllersLogic/DeletePackingListLogic.php b/app/Classes/Modules/PackingLists/ControllersLogic/DeletePackingListLogic.php index 850f196b..09f6453f 100644 --- a/app/Classes/Modules/PackingLists/ControllersLogic/DeletePackingListLogic.php +++ b/app/Classes/Modules/PackingLists/ControllersLogic/DeletePackingListLogic.php @@ -7,6 +7,7 @@ use App\Classes\General\Abstracts\AbstractControllerLogic; use App\Classes\Modules\PackingLists\Services\DeletesPackingList; use App\Classes\Modules\PackingLists\Services\FetchesPackingList; use App\Classes\Modules\PackingLists\Standards\Rules\CanDeletePackingList; +use App\Classes\ValueObjects\Constants\PackingListType; use ErrorException; use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; @@ -58,9 +59,11 @@ class DeletePackingListLogic extends AbstractControllerLogic $this->canDeletePackingList->passes(); - $query = $this->fetchesPackingList->execute(['id' => $request->route('id')]); + $warehouseList = $this->fetchesPackingList->execute(['id' => $request->route('id')]); + $packingList = $this->fetchesPackingList->execute(['reference' => $warehouseList->reference, 'type' => PackingListType::SHIPPING_PACKING_LIST]); - $this->deletesPackingList->execute($query); + $this->deletesPackingList->execute($warehouseList); + $this->deletesPackingList->execute($packingList); return $this->response([]);