Skip to content

Commit 383f00e

Browse files
feat(billing): invalidate addons query when custom domain is deleted (supabase#39967)
1 parent 0910908 commit 383f00e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

apps/studio/data/custom-domains/custom-domains-delete-mutation.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react
22
import { toast } from 'sonner'
33

44
import { del, handleError } from 'data/fetchers'
5+
import { subscriptionKeys } from 'data/subscriptions/keys'
56
import type { ResponseError } from 'types'
67
import { customDomainKeys } from './keys'
78

@@ -47,6 +48,9 @@ export const useCustomDomainDeleteMutation = ({
4748
}
4849
})
4950

51+
// Invalidate addons cache since the backend removes the addon when deleting the domain
52+
await queryClient.invalidateQueries({ queryKey: subscriptionKeys.addons(projectRef) })
53+
5054
await onSuccess?.(data, variables, context)
5155
},
5256
async onError(data, variables, context) {

0 commit comments

Comments
 (0)