Skip to content

Commit

Permalink
refactor: unhappy flow first
Browse files Browse the repository at this point in the history
  • Loading branch information
EdieLemoine committed Sep 18, 2023
1 parent 53b2a63 commit 4b6fa55
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/Hooks/HasPdkOrderHooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@ trait HasPdkOrderHooks
*/
public function hookActionObjectCustomerMessageAddAfter(array $params): void
{
if ($params['object'] instanceof CustomerMessage) {
$message = $params['object'];
$thread = new CustomerThread($message->id_customer_thread);

Actions::execute(PdkBackendActions::POST_ORDER_NOTES, [
'orderIds' => [$thread->id_order],
]);
if (! $params['object'] instanceof CustomerMessage) {
return;
}

$message = $params['object'];
$thread = new CustomerThread($message->id_customer_thread);

Actions::execute(PdkBackendActions::POST_ORDER_NOTES, [
'orderIds' => [$thread->id_order],
]);
}

/**
Expand Down

0 comments on commit 4b6fa55

Please sign in to comment.