Invalidate and add success message (#10907)

Co-authored-by: Bailey Pumfleet <bailey@pumfleet.co.uk>
pull/10929/head^2
sean-brydon 2023-08-24 11:18:59 +01:00 committed by GitHub
parent 874ad29676
commit fde3e8bea9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 0 deletions

View File

@ -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) {

View File

@ -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();
},

View File

@ -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();
},
});