feat(billing): invalidate addons query when custom domain is deleted (#39967)

This commit is contained in:
Kanishk Dudeja authored and GitHub committed 2025-10-29 16:52:25 +05:30
1 parent 0910908561
commit 383f00e302
1 file changed
+4
@@ -2,6 +2,7 @@ import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react
import { toast } from 'sonner'
import { del, handleError } from 'data/fetchers'
import { subscriptionKeys } from 'data/subscriptions/keys'
import type { ResponseError } from 'types'
import { customDomainKeys } from './keys'
@@ -47,6 +48,9 @@ export const useCustomDomainDeleteMutation = ({
}
})
// Invalidate addons cache since the backend removes the addon when deleting the domain
await queryClient.invalidateQueries({ queryKey: subscriptionKeys.addons(projectRef) })
await onSuccess?.(data, variables, context)
},
async onError(data, variables, context) {