Skip to content

Commit

Permalink
Refactor cpi_cutoff input validation in Step3 component
Browse files Browse the repository at this point in the history
  • Loading branch information
AkshatGupta15 committed Oct 3, 2024
1 parent 64fe144 commit 66ea0b5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pages/admin/rc/[rcid]/proforma/[proformaid]/step3.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,10 @@ function Step3() {
variant="standard"
error={!!errors.cpi_cutoff}
helperText={errors.cpi_cutoff && "This field is required"}
{...register("cpi_cutoff", { required: true })}
{...register("cpi_cutoff", {
required: true,
setValueAs: (value) => parseFloat(value),
})}
/>
</FormControl>
<FormControl sx={{ m: 1 }}>
Expand Down

0 comments on commit 66ea0b5

Please sign in to comment.