Skip to content

Commit

Permalink
fix(financial entry): set the main document regardless of matches
Browse files Browse the repository at this point in the history
  • Loading branch information
KennethTrecy committed Sep 17, 2023
1 parent 50af3fd commit 26df56f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/Controllers/FinancialEntryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ protected static function enrichResponseDocument(array $initial_document): array
$modifiers = model(ModifierModel::class)
->whereIn("id", array_unique($linked_modifiers))
->findAll();
}

if ($is_single_main_document) {
$enriched_document["modifier"] = $modifiers[0];
} else {
$enriched_document["modifiers"] = $modifiers;
}
if ($is_single_main_document) {
$enriched_document["modifier"] = $modifiers[0] ?? null;
} else {
$enriched_document["modifiers"] = $modifiers;
}

$linked_accounts = [];
Expand Down

0 comments on commit 26df56f

Please sign in to comment.