Skip to content

Commit

Permalink
fix: HS-1111: invalid country options (#141)
Browse files Browse the repository at this point in the history
  • Loading branch information
prafulkoppalkar authored Feb 5, 2024
1 parent 6df1b3b commit 4198ace
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/Payments/PaymentMethodsRecord.res
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,11 @@ let getPaymentMethodsFieldTypeFromDict = dict => {
switch options->Belt.Array.get(0)->Belt.Option.getWithDefault("") {
| "" => None
| "ALL" => AddressCountry(Country.country->Js.Array2.map(item => item.countryName))
| _ => AddressCountry(options)
| _ => AddressCountry(
Country.country
->Js.Array2.filter(item => options->Js.Array2.includes(item.isoAlpha2))
->Js.Array2.map(item => item.countryName),
)
}
}
| _ => None
Expand Down
4 changes: 2 additions & 2 deletions src/Utilities/DynamicFieldsUtils.res
Original file line number Diff line number Diff line change
Expand Up @@ -547,10 +547,10 @@ let combineCountryAndPostal = arr => {
acc->Js.Array2.concat(
switch item {
| AddressCountry(val) => val
| _ => [""]
| _ => []
},
)
}, [""])
}, [])

if hasCountryAndPostal {
arr->Js.Array2.push(CountryAndPincode(options))->ignore
Expand Down

0 comments on commit 4198ace

Please sign in to comment.