Skip to content

Commit

Permalink
refactor: prevent unnecessary early return
Browse files Browse the repository at this point in the history
  • Loading branch information
joerivanveen committed Dec 17, 2024
1 parent 494f7de commit 5f869e2
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/App/Webhook/Hook/ShipmentStatusChangeWebhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,13 @@ public function handle(Request $request): void
// translate order_id (which is api identifier / uuid) to local order id for db
$order = Pdk::get(PdkOrderRepositoryInterface::class)->getByApiIdentifier($content['order_id']);

if (! $order) {
return;
if ($order) {
Actions::execute(PdkBackendActions::UPDATE_SHIPMENTS, [
'orderIds' => [$order->getExternalIdentifier()],
'shipmentIds' => [$content['shipment_id']],
'linkFirstShipmentToFirstOrder' => true,
]);
}

Actions::execute(PdkBackendActions::UPDATE_SHIPMENTS, [
'orderIds' => [$order->getExternalIdentifier()],
'shipmentIds' => [$content['shipment_id']],
'linkFirstShipmentToFirstOrder' => true,
]);
}


Expand Down

0 comments on commit 5f869e2

Please sign in to comment.