Skip to content

Commit

Permalink
Merge pull request #660 from bigcapitalhq/fix-cast-array-rule-ids
Browse files Browse the repository at this point in the history
fix: Array cast of recognize function rule ids
  • Loading branch information
abouolia authored Sep 4, 2024
2 parents 85acc85 + f7a7925 commit 16f5cb7
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ export class RecognizeTranasctionsService {
});

const bankRules = await BankRule.query(trx).onBuild((q) => {
const rulesIds = castArray(ruleId);
const rulesIds = !isEmpty(ruleId) ? castArray(ruleId) : [];

if (!isEmpty(rulesIds)) {
if (rulesIds?.length > 0) {
q.whereIn('id', rulesIds);
}
q.withGraphFetched('conditions');
Expand Down

0 comments on commit 16f5cb7

Please sign in to comment.