Skip to content

Commit

Permalink
fix: fetch ami chart with the proper id (#4259)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludtkemorgan authored Aug 21, 2024
1 parent 2e6ccfe commit 54a1429
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -519,15 +519,15 @@ const UnitForm = ({ onSubmit, onClose, defaultUnit, nextId, draft }: UnitFormPro
errorMessage={t("errors.requiredFieldError")}
validation={{ required: true }}
inputProps={{
onChange: () => {
onChange: (value) => {
setValue("amiPercentage", undefined)
clearErrors("amiPercentage")
clearErrors("amiChart.id")
;[...Array(maxAmiHouseholdSize)].forEach((_, index) => {
setValue(`maxIncomeHouseholdSize${index + 1}`, undefined)
})
if (amiChartID && !loading && amiChartsOptions) {
void fetchAmiChart()
if (value?.target?.value && !loading && amiChartsOptions) {
void fetchAmiChart(value.target.value)
setIsAmiPercentageDirty(true)
}
},
Expand Down

0 comments on commit 54a1429

Please sign in to comment.