refactor: moved mutate to 'finally' block (#1722)

* refactor: moved mutate to 'finally' block

fix: content for success

* fix: invited -> added
This commit is contained in:
Dakshesh Jain 2023-07-31 17:21:37 +05:30 committed by GitHub
parent 98d9763f8e
commit 81b1405448
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -93,7 +93,6 @@ const SendProjectInvitationModal: React.FC<Props> = ({ isOpen, setIsOpen, member
.inviteProject(workspaceSlug as string, projectId as string, payload, user)
.then(() => {
setIsOpen(false);
mutate(PROJECT_MEMBERS(projectId as string));
setToastAlert({
title: "Success",
type: "success",
@ -105,6 +104,7 @@ const SendProjectInvitationModal: React.FC<Props> = ({ isOpen, setIsOpen, member
})
.finally(() => {
reset(defaultValues);
mutate(PROJECT_MEMBERS(projectId.toString()));
});
};