Skip to content

Commit 0838347

Browse files
committed
revert random change
1 parent 6d0fbf6 commit 0838347

File tree

1 file changed

+19
-23
lines changed

1 file changed

+19
-23
lines changed

static/app/components/events/autofix/autofixInsightCards.tsx

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -507,34 +507,30 @@ function useUpdateInsightCard({groupId, runId}: {groupId: string; runId: string}
507507
const orgSlug = useOrganization().slug;
508508

509509
return useMutation({
510-
mutationFn: async (params: {
510+
mutationFn: (params: {
511511
message: string;
512512
retain_insight_card_index: number | null;
513513
step_index: number;
514514
}) => {
515-
try {
516-
const response = await api.requestPromise(
517-
`/organizations/${orgSlug}/issues/${groupId}/autofix/update/`,
518-
{
519-
method: 'POST',
520-
data: {
521-
run_id: runId,
522-
payload: {
523-
type: 'restart_from_point_with_feedback',
524-
message: params.message.trim(),
525-
step_index: params.step_index,
526-
retain_insight_card_index: params.retain_insight_card_index,
527-
},
515+
return api.requestPromise(
516+
`/organizations/${orgSlug}/issues/${groupId}/autofix/update/`,
517+
{
518+
method: 'POST',
519+
data: {
520+
run_id: runId,
521+
payload: {
522+
type: 'restart_from_point_with_feedback',
523+
message: params.message.trim(),
524+
step_index: params.step_index,
525+
retain_insight_card_index: params.retain_insight_card_index,
528526
},
529-
}
530-
);
531-
queryClient.invalidateQueries({queryKey: makeAutofixQueryKey(orgSlug, groupId)});
532-
addSuccessMessage(t('Rethinking this...'));
533-
return response;
534-
} catch (e) {
535-
addErrorMessage(t('Something went wrong when sending Seer your message.'));
536-
throw e;
537-
}
527+
},
528+
}
529+
);
530+
},
531+
onSuccess: _ => {
532+
queryClient.invalidateQueries({queryKey: makeAutofixQueryKey(orgSlug, groupId)});
533+
addSuccessMessage(t('Rethinking this...'));
538534
},
539535
onError: () => {
540536
addErrorMessage(t('Something went wrong when sending Seer your message.'));

0 commit comments

Comments
 (0)