diff --git a/packages/console/src/pages/TenantSettings/TenantMembers/Invitations/index.tsx b/packages/console/src/pages/TenantSettings/TenantMembers/Invitations/index.tsx index 4d2819975be..f79c6f6a05d 100644 --- a/packages/console/src/pages/TenantSettings/TenantMembers/Invitations/index.tsx +++ b/packages/console/src/pages/TenantSettings/TenantMembers/Invitations/index.tsx @@ -17,6 +17,7 @@ import { useAuthedCloudApi } from '@/cloud/hooks/use-cloud-api'; import type { InvitationResponse, TenantInvitationResponse } from '@/cloud/types/router'; import Breakable from '@/components/Breakable'; import { RoleOption } from '@/components/OrganizationRolesSelect'; +import { SubscriptionDataContext } from '@/contexts/SubscriptionDataProvider'; import { TenantsContext } from '@/contexts/TenantsProvider'; import ActionMenu, { ActionMenuItem } from '@/ds-components/ActionMenu'; import Button from '@/ds-components/Button'; @@ -56,7 +57,7 @@ function Invitations() { const { access: { canInviteMember, canRemoveMember }, } = useCurrentTenantScopes(); - + const { mutateSubscriptionQuotaAndUsages } = useContext(SubscriptionDataContext); const { data, error, isLoading, mutate } = useSWR( `api/tenants/${currentTenantId}/invitations`, async () => @@ -80,6 +81,7 @@ function Invitations() { params: { tenantId: currentTenantId, invitationId }, body: { status: OrganizationInvitationStatus.Revoked }, }); + mutateSubscriptionQuotaAndUsages(); void mutate(); toast.success(t('messages.invitation_revoked')); }; @@ -97,6 +99,7 @@ function Invitations() { await cloudApi.delete(`/api/tenants/:tenantId/invitations/:invitationId`, { params: { tenantId: currentTenantId, invitationId }, }); + mutateSubscriptionQuotaAndUsages(); void mutate(); toast.success(t('messages.invitation_deleted')); }; diff --git a/packages/console/src/pages/TenantSettings/TenantMembers/InviteMemberModal/index.tsx b/packages/console/src/pages/TenantSettings/TenantMembers/InviteMemberModal/index.tsx index 2fbf99b8fde..d4f07a2303b 100644 --- a/packages/console/src/pages/TenantSettings/TenantMembers/InviteMemberModal/index.tsx +++ b/packages/console/src/pages/TenantSettings/TenantMembers/InviteMemberModal/index.tsx @@ -45,6 +45,7 @@ function InviteMemberModal({ isOpen, onClose }: Props) { currentSubscription: { planId, isAddOnAvailable }, currentSubscriptionQuota, currentSubscriptionUsage: { tenantMembersLimit }, + mutateSubscriptionQuotaAndUsages, } = useContext(SubscriptionDataContext); const { data: { tenantMembersUpsellNoticeAcknowledged }, @@ -109,6 +110,7 @@ function InviteMemberModal({ isOpen, onClose }: Props) { params: { tenantId: currentTenantId }, body: { invitee: emails.map(({ value }) => value), roleName: role }, }); + mutateSubscriptionQuotaAndUsages(); toast.success(t('tenant_members.messages.invitation_sent')); onClose(true); } finally {