Closed KentShikama closed 4 years ago
@KentShikama I'm not super clear on the backend but want to fix this one. How would I check the charge eligibility in the case file ? I was thinking of adding a second condition to my ternary that checks if eligible
Since the banner is applied on the case, the logic more precisely is that if all charges on the case are ineligible, then don't show the banner. Everything comes as part of the record summary object from the backend. See the response object for the /api/search endpoint request at Tools -> Web Developer -> Network
.
Thanks @KentShikama! With that logic I can still see the banner if say one charge is ineligible but others aren't. @hmarcks used the language "Eligible charges become eligible when balance is paid" can we make the banner say that or "Eligible charges are ineligible until balance is paid"
The updated logic
let allIneligible = 0
for (let i = 0; i < charges.length; i++){
let typeEligibility = charges[i].expungement_result.type_eligibility.status
if (typeEligibility == "Ineligible") {
ineligibleCharges++
}
}
if (ineligibleCharges == charges.length) {
allIneligible=1
}