Skip to content

Commit

Permalink
chore: converted Js to Core
Browse files Browse the repository at this point in the history
  • Loading branch information
Pritish Budhiraja committed Mar 14, 2024
1 parent 42e9c71 commit b78ed90
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Components/SurchargeUtils.res
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ let useSurchargeDetailsForOneClickWallets = (~list) => {
~list,
~paymentMethod="wallet",
~paymentMethodType=wallet.paymentMethodType,
)->Belt.Option.getWithDefault(PaymentMethodsRecord.defaultPaymentMethodType)
)->Option.getOr(PaymentMethodsRecord.defaultPaymentMethodType)
switch paymentMethodType.surcharge_details {
| Some(surchargDetails) =>
acc->Array.concat([
Expand Down
4 changes: 2 additions & 2 deletions src/Utilities/DynamicFieldsUtils.res
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,8 @@ let useRequiredFieldsBody = (
| Bank =>
(
Bank.getBanks(paymentMethodType)
->Js.Array2.find(item => item.displayName == selectedBank)
->Belt.Option.getWithDefault(Bank.defaultBank)
->Array.find(item => item.displayName == selectedBank)
->Option.getOr(Bank.defaultBank)
).hyperSwitch
| AddressCountry(_) => {
let countryCode =
Expand Down
2 changes: 1 addition & 1 deletion src/Utilities/Utils.res
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ let getHeaders = (~uri=?, ~token=?, ~headers=Dict.make(), ()) => {
})
Fetch.Headers.fromObject(headerObj->dictToObj)
}
let fetchApi = (uri, ~bodyStr: string="", ~headers=Js.Dict.empty(), ~method: Fetch.method, ()) => {
let fetchApi = (uri, ~bodyStr: string="", ~headers=Dict.make(), ~method: Fetch.method, ()) => {
open Promise
let body = switch method {
| #GET => resolve(None)
Expand Down

0 comments on commit b78ed90

Please sign in to comment.