Skip to content

Commit

Permalink
fix: json stringify
Browse files Browse the repository at this point in the history
  • Loading branch information
Pritish Budhiraja committed Jan 16, 2024
1 parent 2398f7b commit bf2d7e2
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/screens/HyperSwitch/UserManagement/InviteUsers.res
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,20 @@ let make = () => {
let passwordFromResponse = response->getDictFromJsonObject->getString("password", "")
emailPasswordsArray->Array.push(
[
("email", body->LogicUtils.getDictFromJsonObject->LogicUtils.getString("email", "")),
("password", passwordFromResponse),
]->Dict.fromArray,
(
"email",
body
->LogicUtils.getDictFromJsonObject
->LogicUtils.getString("email", "")
->Js.Json.string,
),
("password", passwordFromResponse->Js.Json.string),
]
->Dict.fromArray
->Js.Json.object_,
)
}

if index === 0 {
showToast(
~message=magicLink
Expand All @@ -112,11 +121,7 @@ let make = () => {
if !magicLink {
DownloadUtils.download(
~fileName=`invited-users.txt`,
~content=emailPasswordsArray
->Js.Json.stringifyAny
->Option.getWithDefault("")
->Js.Json.parseExn
->Js.Json.stringifyWithSpace(3),
~content=emailPasswordsArray->Js.Json.array->Js.Json.stringifyWithSpace(3),
~fileType="application/json",
)
}
Expand Down

0 comments on commit bf2d7e2

Please sign in to comment.