Invalidate and add success message (#10907)
Co-authored-by: Bailey Pumfleet <bailey@pumfleet.co.uk>pull/10929/head^2
parent
874ad29676
commit
fde3e8bea9
|
@ -35,6 +35,7 @@ export default function TeamInviteList(props: Props) {
|
|||
const deleteTeamMutation = trpc.viewer.teams.delete.useMutation({
|
||||
async onSuccess() {
|
||||
await utils.viewer.teams.list.invalidate();
|
||||
await utils.viewer.teams.get.invalidate();
|
||||
await utils.viewer.organizations.listMembers.invalidate();
|
||||
},
|
||||
async onError(err) {
|
||||
|
|
|
@ -11,6 +11,7 @@ import {
|
|||
DropdownMenuItem,
|
||||
DropdownItem,
|
||||
DropdownMenuTrigger,
|
||||
showToast,
|
||||
} from "@calcom/ui";
|
||||
import { Ban, Check, MoreHorizontal, X } from "@calcom/ui/components/icon";
|
||||
|
||||
|
@ -39,7 +40,9 @@ export default function TeamInviteListItem(props: Props) {
|
|||
|
||||
const acceptOrLeaveMutation = trpc.viewer.teams.acceptOrLeave.useMutation({
|
||||
onSuccess: async () => {
|
||||
showToast(t("success"), "success");
|
||||
await utils.viewer.teams.get.invalidate();
|
||||
await utils.viewer.teams.hasTeamPlan.invalidate();
|
||||
await utils.viewer.teams.list.invalidate();
|
||||
await utils.viewer.organizations.listMembers.invalidate();
|
||||
},
|
||||
|
|
|
@ -67,7 +67,10 @@ export default function TeamListItem(props: Props) {
|
|||
|
||||
const acceptOrLeaveMutation = trpc.viewer.teams.acceptOrLeave.useMutation({
|
||||
onSuccess: () => {
|
||||
showToast(t("success"), "success");
|
||||
utils.viewer.teams.get.invalidate();
|
||||
utils.viewer.teams.list.invalidate();
|
||||
utils.viewer.teams.hasTeamPlan.invalidate();
|
||||
utils.viewer.teams.listInvites.invalidate();
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue