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