Skip to content

Commit

Permalink
Refactored booking->options due to dhl24 method requirements.
Browse files Browse the repository at this point in the history
  • Loading branch information
xGrz committed Jun 18, 2024
1 parent bbda676 commit c64e2ad
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Http/Controllers/SingleShipmentBookingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function create(DHLShipment $shipment)
return view('dhl-ui::shipments.create-booking', [
'title' => 'Book courier',
'shipment' => $shipment,
'dateOptions' => DHL24::booking()->options($shipment->shipper_postal_code)->availableDates(),
'dateOptions' => DHL24::booking()->options($shipment)->availableDates(),
]);
}
}
6 changes: 3 additions & 3 deletions src/Livewire/CreateMassBooking.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ private function getDateOptions()
self::resetBooking();
return;
}
$this->dateOptions = DHL24::booking()->options($this->postalCode)->availableDates();
$this->dateOptions = DHL24::booking()->options(self::getSelectedShipments())->availableDates();
$this->pickupDate = $this->dateOptions[0];
}

Expand All @@ -122,7 +122,7 @@ private function refreshPickupFromOptions(): array
{
if (!$this->postalCode) return [];
$pickupFromOptions = DHL24::booking()
->options($this->postalCode, self::getSelectedShipments())
->options(self::getSelectedShipments())
->pickupStartingOptions(Carbon::parse($this->pickupDate));
$testArr = [];
foreach ($pickupFromOptions as $pickupFromOption) {
Expand All @@ -141,7 +141,7 @@ private function refreshPickupToOptions(): array
{
if (!$this->postalCode) return [];
$pickupToOptions = DHL24::booking()
->options($this->postalCode, self::getSelectedShipments())
->options(self::getSelectedShipments())
->pickupEndingOptions(Carbon::parse($this->pickupDate . ' ' . $this->pickupFrom));
$testArr = [];
foreach ($pickupToOptions as $pickupToOption) {
Expand Down
4 changes: 2 additions & 2 deletions src/Livewire/CreateSingleShipmentBooking.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function book()
private function refreshPickupFromOptions(): array
{
$pickupFromOptions = DHL24::booking()
->options($this->postalCode)
->options($this->shipment)
->pickupStartingOptions(Carbon::parse($this->pickupDate));
$testArr = [];
foreach ($pickupFromOptions as $pickupFromOption) {
Expand All @@ -70,7 +70,7 @@ private function refreshPickupFromOptions(): array
private function refreshPickupToOptions(): array
{
$pickupToOptions = DHL24::booking()
->options($this->postalCode)
->options($this->shipment)
->pickupEndingOptions(Carbon::parse($this->pickupDate . ' ' . $this->pickupFrom));
$testArr = [];
foreach ($pickupToOptions as $pickupToOption) {
Expand Down

0 comments on commit c64e2ad

Please sign in to comment.