Refactor add users to org handlers

This commit is contained in:
Daniel Hougaard
2024-08-23 02:25:14 +04:00
parent 60df59c7f0
commit 8ca70eec44
2 changed files with 13 additions and 13 deletions
@@ -18,7 +18,7 @@ import {
} from "@app/context";
import { useTimedReset } from "@app/hooks";
import {
useAddUserToOrg,
useAddUsersToOrg,
useFetchServerStatus,
useGetOrgMembership,
useGetOrgRoles
@@ -44,18 +44,18 @@ export const UserDetailsSection = ({ membershipId, handlePopUpOpen }: Props) =>
const { data: roles } = useGetOrgRoles(orgId);
const { data: serverDetails } = useFetchServerStatus();
const { data: membership } = useGetOrgMembership(orgId, membershipId);
const { mutateAsync: inviteUser, isLoading } = useAddUserToOrg();
const { mutateAsync: inviteUsers, isLoading } = useAddUsersToOrg();
const onResendInvite = async (email: string) => {
try {
const { data } = await inviteUser({
const { data } = await inviteUsers({
organizationId: orgId,
inviteeEmail: email
inviteeEmails: [email]
});
// setCompleteInviteLink(data?.completeInviteLink || "");
if (!data.completeInviteLink) {
if (!data.completeInviteLinks) {
createNotification({
text: `Successfully resent invite to ${email}`,
type: "success"