Skip to content

Commit

Permalink
fix: Amount Filter bug (#1900)
Browse files Browse the repository at this point in the history
  • Loading branch information
kanikabansal-juspay authored Dec 11, 2024
1 parent 2fb1d23 commit 5761c53
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let make = (~connector, ~setShowWalletConfigurationModal, ~update, ~onCloseClick
->getDictfromDict("paze")

form.change(
"connector_wallets_details.samsung_pay.merchant_credentials",
"connector_wallets_details.paze",
initalFormValue->pazePayRequest->Identity.genericTypeToJson,
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,17 @@ let make = (~options) => {
form.change("end_amount", JSON.Encode.null)
form.change("amount_option", mappedRange->Identity.genericTypeToJson)
setSelectedOption(_ => {newValue->mapStringToRange})
} else {
setIsAmountRangeVisible(_ => true)
}
}

let input: ReactFinalForm.fieldRenderPropsInput = {
name: "amount",
onBlur: _ => (),
onChange: ev => handleInputChange(ev->Identity.formReactEventToString),
onChange: ev => {
handleInputChange(ev->Identity.formReactEventToString)
},
onFocus: _ => (),
value: selectedOption->mapRangeTypetoString->JSON.Encode.string,
checked: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ let amountFilterOptions: array<FilterSelectBox.dropdownOption> = [
value: label,
}
})
let encodeFloatOrDefault = val => (val->getFloatFromJson(0.0) *. 100.0)->JSON.Encode.float
let encodeFloatOrDefault = val =>
(val->getFloatFromJson(0.0) *. 100.0)->Float.toFixed->getFloatFromString(0.0)->JSON.Encode.float
let validateAmount = dict => {
let sAmntK = dict->getFloat((#start_amount: AmountFilterTypes.amountFilterChild :> string), -1.0)
let eAmtK = dict->getFloat((#end_amount: AmountFilterTypes.amountFilterChild :> string), -1.0)
Expand Down

0 comments on commit 5761c53

Please sign in to comment.