@@ -507,34 +507,30 @@ function useUpdateInsightCard({groupId, runId}: {groupId: string; runId: string}
507
507
const orgSlug = useOrganization ( ) . slug ;
508
508
509
509
return useMutation ( {
510
- mutationFn : async ( params : {
510
+ mutationFn : ( params : {
511
511
message : string ;
512
512
retain_insight_card_index : number | null ;
513
513
step_index : number ;
514
514
} ) => {
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 ,
528
526
} ,
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...' ) ) ;
538
534
} ,
539
535
onError : ( ) => {
540
536
addErrorMessage ( t ( 'Something went wrong when sending Seer your message.' ) ) ;
0 commit comments