Skip to content

Commit

Permalink
Merge pull request #1697 from wittejm/jw/bugfix-generate-forms
Browse files Browse the repository at this point in the history
Generate forms won't get an empty array error
  • Loading branch information
monocle authored May 3, 2023
2 parents 2e9f47e + 579f5f1 commit 98401c0
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,15 @@ export default function RecordSummary() {
} = summary;

const handleGenerateFormsClick = () => {
const chargesEligibleNow = groupedCharges?.filter(
(x) => x[0] === "Eligible Now"
);
const chargesEligibleOnIneligible = groupedCharges?.filter(
(x) => x[0] === "Eligible on case with Ineligible charge"
);
if (
groupedCharges?.filter((x) => x[0] === "Eligible Now" || x[0] === "Eligible on case with Ineligible charge")[0][1]?.length > 0
(chargesEligibleNow[0] && chargesEligibleNow[0][1].length > 0) ||
(chargesEligibleOnIneligible[0] && chargesEligibleOnIneligible[0][1].length > 0)
) {
history.push("/fill-expungement-forms");
} else {
Expand Down

0 comments on commit 98401c0

Please sign in to comment.