Skip to content

Commit 3123ad2

Browse files
committed
fixes
1 parent f906a79 commit 3123ad2

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

static/app/views/automations/components/editAutomationActions.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ export function EditAutomationActions({automation}: EditAutomationActionsProps)
3434
enabled: newEnabled,
3535
},
3636
{
37-
onSuccess: () => {
37+
onSuccess: data => {
3838
addSuccessMessage(
39-
newEnabled ? t('Automation enabled') : t('Automation disabled')
39+
data.enabled ? t('Automation enabled') : t('Automation disabled')
4040
);
4141
},
4242
}

static/app/views/detectors/components/details/common/actions.tsx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ export function DisableDetectorAction({detector}: {detector: Detector}) {
2929
enabled: newEnabled,
3030
},
3131
{
32-
onSuccess: () => {
33-
addSuccessMessage(newEnabled ? t('Monitor enabled') : t('Monitor disabled'));
32+
onSuccess: data => {
33+
addSuccessMessage(data.enabled ? t('Monitor enabled') : t('Monitor disabled'));
3434
},
3535
}
3636
);
@@ -82,19 +82,17 @@ export function EditDetectorAction({detector}: {detector: Detector}) {
8282
export function DeleteDetectorAction({detector}: {detector: Detector}) {
8383
const organization = useOrganization();
8484
const navigate = useNavigate();
85-
const {mutate: deleteDetector, isPending: isDeleting} = useDeleteDetectorMutation();
85+
const {mutateAsync: deleteDetector, isPending: isDeleting} =
86+
useDeleteDetectorMutation();
8687

8788
const handleDelete = useCallback(() => {
8889
openConfirmModal({
8990
message: t('Are you sure you want to delete this monitor?'),
9091
confirmText: t('Delete'),
9192
priority: 'danger',
92-
onConfirm: () => {
93-
deleteDetector(detector.id, {
94-
onSuccess: () => {
95-
navigate(makeMonitorBasePathname(organization.slug));
96-
},
97-
});
93+
onConfirm: async () => {
94+
await deleteDetector(detector.id);
95+
navigate(makeMonitorBasePathname(organization.slug));
9896
},
9997
});
10098
}, [deleteDetector, detector.id, navigate, organization.slug]);

static/app/views/detectors/components/forms/error/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ export function EditExistingErrorDetectorForm({detector}: {detector: ErrorDetect
117117
type: 'error',
118118
name: detector.name,
119119
owner: detector.owner,
120-
enabled: detector.enabled,
121120
projectId: detector.projectId,
122121
workflowIds: data.workflowIds,
123122
dataSource: {},

0 commit comments

Comments
 (0)