@@ -4,20 +4,19 @@ import styled from '@emotion/styled';
4
4
import autofixSetupImg from 'sentry-images/features/autofix-setup.svg' ;
5
5
6
6
import { addSuccessMessage } from 'sentry/actionCreators/indicator' ;
7
- import { promptsUpdate } from 'sentry/actionCreators/prompts' ;
8
7
import { Alert } from 'sentry/components/core/alert' ;
9
8
import { Button } from 'sentry/components/core/button' ;
10
9
import { Flex } from 'sentry/components/core/layout' ;
11
10
import { useAutofixSetup } from 'sentry/components/events/autofix/useAutofixSetup' ;
12
11
import { useOrganizationSeerSetup } from 'sentry/components/events/autofix/useOrganizationSeerSetup' ;
12
+ import { useSeerAcknowledgeMutation } from 'sentry/components/events/autofix/useSeerAcknowledgeMutation' ;
13
13
import ExternalLink from 'sentry/components/links/externalLink' ;
14
14
import LoadingIndicator from 'sentry/components/loadingIndicator' ;
15
15
import { DATA_CATEGORY_INFO } from 'sentry/constants' ;
16
16
import { IconRefresh , IconSeer } from 'sentry/icons' ;
17
17
import { t , tct } from 'sentry/locale' ;
18
18
import { space } from 'sentry/styles/space' ;
19
19
import { DataCategory } from 'sentry/types/core' ;
20
- import { useMutation , useQueryClient } from 'sentry/utils/queryClient' ;
21
20
import useApi from 'sentry/utils/useApi' ;
22
21
import { useNavigate } from 'sentry/utils/useNavigate' ;
23
22
import useOrganization from 'sentry/utils/useOrganization' ;
@@ -37,7 +36,6 @@ type AiSetupDataConsentProps = {
37
36
function AiSetupDataConsent ( { groupId} : AiSetupDataConsentProps ) {
38
37
const api = useApi ( { persistInFlight : true } ) ;
39
38
const organization = useOrganization ( ) ;
40
- const queryClient = useQueryClient ( ) ;
41
39
const navigate = useNavigate ( ) ;
42
40
const subscription = useSubscription ( ) ;
43
41
@@ -82,29 +80,7 @@ function AiSetupDataConsent({groupId}: AiSetupDataConsentProps) {
82
80
! isTouchCustomer &&
83
81
! hasSeerButNeedsPayg ;
84
82
85
- const autofixAcknowledgeMutation = useMutation ( {
86
- mutationFn : ( ) => {
87
- return promptsUpdate ( api , {
88
- organization,
89
- feature : 'seer_autofix_setup_acknowledged' ,
90
- status : 'dismissed' ,
91
- } ) ;
92
- } ,
93
- onSuccess : ( ) => {
94
- // Invalidate the appropriate query based on mode
95
- if ( isGroupMode && groupId ) {
96
- queryClient . invalidateQueries ( {
97
- queryKey : [
98
- `/organizations/${ organization . slug } /issues/${ groupId } /autofix/setup/` ,
99
- ] ,
100
- } ) ;
101
- } else {
102
- queryClient . invalidateQueries ( {
103
- queryKey : [ `/organizations/${ organization . slug } /seer/setup-check/` ] ,
104
- } ) ;
105
- }
106
- } ,
107
- } ) ;
83
+ const autofixAcknowledgeMutation = useSeerAcknowledgeMutation ( ) ;
108
84
109
85
function handlePurchaseSeer ( ) {
110
86
navigate ( `/settings/billing/checkout/?referrer=ai_setup_data_consent` ) ;
0 commit comments