Skip to content

Commit

Permalink
user role invite issue fix (#581)
Browse files Browse the repository at this point in the history
  • Loading branch information
vishnuszipstack authored Aug 14, 2024
1 parent 3d4b4dc commit a65f527
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions frontend/src/components/settings/invite/InviteEditUser.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ function InviteEditUser() {
setLoading(false);
});
};
const inviteUserToOrg = async (email) => {
const inviteUserToOrg = async (value) => {
const requestOptions = {
method: "POST",
url: `/api/v1/unstract/${sessionDetails?.orgId}/users/invite/`,
data: { users: [{ email: email }] },
data: { users: [value] },
headers: {
"X-CSRFToken": sessionDetails?.csrfToken,
"Content-Type": "application/json",
Expand Down Expand Up @@ -121,7 +121,10 @@ function InviteEditUser() {
const onSubmit = (values) => {
setSubmitLoading(true);
if (isInvite) {
inviteUserToOrg(values.email);
const roleName = userRoles?.filter((val) => val.id === values.role)[0]
?.name;
values.role = roleName;
inviteUserToOrg(values);
} else {
updateUserRole(values);
}
Expand Down

0 comments on commit a65f527

Please sign in to comment.