Skip to content

Commit

Permalink
feat(Violations): Remove unnecessary casts
Browse files Browse the repository at this point in the history
Co-authored-by: Carlos Alvarez <[email protected]>
  • Loading branch information
trevor-coleman and cead22 authored Nov 30, 2023
1 parent 47afbe9 commit bc3b872
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/libs/Violations/ViolationsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ const ViolationsUtils = {
let newTransactionViolations = [...transactionViolations];

if (policyRequiresCategories) {
const hasCategoryViolation = Boolean(transactionViolations.some((violation) => Boolean(violation.name === 'categoryOutOfPolicy')));
const hasMissingCategoryViolation = Boolean(transactionViolations.some((violation) => Boolean(violation.name === 'missingCategory')));

const hasCategoryOutOfPolicyViolation = transactionViolations.some((violation) => violation.name === 'categoryOutOfPolicy');
const hasMissingCategoryViolation = transactionViolations.some((violation) => violation.name === 'missingCategory');
const isCategoryInPolicy = Boolean(policyCategories[transaction.category]?.enabled);

// Add 'categoryOutOfPolicy' violation if category is not in policy
Expand Down

0 comments on commit bc3b872

Please sign in to comment.