Skip to content

Commit

Permalink
feat: Resend Invite Removal
Browse files Browse the repository at this point in the history
  • Loading branch information
Pritish Budhiraja committed Dec 20, 2023
1 parent ffc819e commit 4d46610
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 27 deletions.
6 changes: 3 additions & 3 deletions src/screens/HyperSwitch/APIUtils/APIUtils.res
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ let getURL = (
| #USER_DATA => `${userUrl}/data`
| #MERCHANT_DATA => `${userUrl}/data`
| #INVITE
| #RESEND_INVITE =>
`${userUrl}/user/${(userType :> string)->Js.String2.toLowerCase}`
| #SWITCH_MERCHANT =>
| // | #RESEND_INVITE =>
// `${userUrl}/user/${(userType :> string)->Js.String2.toLowerCase}`
#SWITCH_MERCHANT =>
switch methodType {
| Get => `${userUrl}/switch/list`
| _ => `${userUrl}/${(userType :> string)->Js.String2.toLowerCase}`
Expand Down
4 changes: 2 additions & 2 deletions src/screens/HyperSwitch/APIUtils/APIUtilsTypes.res
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ type userType = [
| #MERCHANT_DATA
| #USER_DATA
| #INVITE
| #RESEND_INVITE
| #CREATE_MERCHANT
| // | #RESEND_INVITE
#CREATE_MERCHANT
| #OSSSIGNIN
| #OSSSIGNUP
| #NONE
Expand Down
44 changes: 22 additions & 22 deletions src/screens/HyperSwitch/UserManagement/ShowUserData.res
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ external typeConversion: array<Js.Nullable.t<UserRoleEntity.userTableTypes>> =>

module UserHeading = {
@react.component
let make = (~infoValue: UserRoleEntity.userTableTypes, ~userId) => {
open APIUtils
let showToast = ToastState.useShowToast()
let updateDetails = useUpdateMethod()
let make = (~infoValue: UserRoleEntity.userTableTypes, ~userId as _) => {
// open APIUtils
// let showToast = ToastState.useShowToast()
// let updateDetails = useUpdateMethod()
let status = infoValue.status->UserRoleEntity.statusToVariantMapper

let resendInvite = async () => {
try {
let url = getURL(~entityName=USERS, ~userType=#RESEND_INVITE, ~methodType=Post, ())
let body = [("user_id", userId->Js.Json.string)]->Js.Dict.fromArray->Js.Json.object_
let _ = await updateDetails(url, body, Post)
showToast(~message=`Invite resend. Please check your email.`, ~toastType=ToastSuccess, ())
} catch {
| _ => ()
}
}
// let resendInvite = async () => {
// try {
// let url = getURL(~entityName=USERS, ~userType=#RESEND_INVITE, ~methodType=Post, ())
// let body = [("user_id", userId->Js.Json.string)]->Js.Dict.fromArray->Js.Json.object_
// let _ = await updateDetails(url, body, Post)
// showToast(~message=`Invite resend. Please check your email.`, ~toastType=ToastSuccess, ())
// } catch {
// | _ => ()
// }
// }

<div className="flex justify-between flex-wrap">
<PageUtils.PageHeading
Expand All @@ -38,14 +38,14 @@ module UserHeading = {
| _ => infoValue.status->Js.String2.toUpperCase->React.string
}}
</div>
<UIUtils.RenderIf condition={status !== Active}>
<Button
text="Resend Invite"
buttonType={SecondaryFilled}
customButtonStyle="!px-2"
onClick={_ => resendInvite()->ignore}
/>
</UIUtils.RenderIf>
// <UIUtils.RenderIf condition={status !== Active}>
// <Button
// text="Resend Invite"
// buttonType={SecondaryFilled}
// customButtonStyle="!px-2"
// onClick={_ => resendInvite()->ignore}
// />
// </UIUtils.RenderIf>
</div>
</div>
}
Expand Down

0 comments on commit 4d46610

Please sign in to comment.