Skip to content

Commit

Permalink
fix: avoid loading benefits and categories from Forma for every claim in
Browse files Browse the repository at this point in the history
`submit-claims-from-csv`
  • Loading branch information
timrogers committed Aug 1, 2023
1 parent d81c7e9 commit a0cc99d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/commands/submit-claims-from-csv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ command
);
}

const benefitsWithCategories = await getBenefitsWithCategories(accessToken);

for (const [index, claim] of claims.entries()) {
const rowNumber = index + 2;
console.log(`Submitting claim ${index + 1}/${claims.length} (row ${rowNumber})`);
Expand All @@ -109,7 +111,6 @@ command
);
await createClaim(createClaimOptions);
} else if (openaiApiKey) {
const benefitsWithCategories = await getBenefitsWithCategories(accessToken);
const { benefit, category } = await attemptToInferCategoryAndBenefit({
merchant: claim.merchant,
description: claim.description,
Expand Down

0 comments on commit a0cc99d

Please sign in to comment.