Skip to content

Commit

Permalink
fix(modifier): allow searching for accounts as required
Browse files Browse the repository at this point in the history
  • Loading branch information
KennethTrecy committed Aug 13, 2023
1 parent fe9c566 commit 6c16ed2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/Controllers/ModifierController.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,12 @@ protected static function enrichResponseDocument(array $initial_document): array
array_push($linked_accounts, $debit_account_id, $credit_account_id);
}

$accounts = model(AccountModel::class)
->whereIn("id", array_unique($linked_accounts))
->findAll();
$accounts = [];
if (count($linked_accounts) > 0) {
$accounts = model(AccountModel::class)
->whereIn("id", array_unique($linked_accounts))
->findAll();
}
$enriched_document["accounts"] = $accounts;

$linked_currencies = [];
Expand Down

0 comments on commit 6c16ed2

Please sign in to comment.