diff --git a/static/app/views/detectors/components/details/common/actions.tsx b/static/app/views/detectors/components/details/common/actions.tsx index 8c259191f38347..582680d4a7f46d 100644 --- a/static/app/views/detectors/components/details/common/actions.tsx +++ b/static/app/views/detectors/components/details/common/actions.tsx @@ -13,8 +13,8 @@ import useOrganization from 'sentry/utils/useOrganization'; import {useUpdateDetector} from 'sentry/views/detectors/hooks'; import {useDeleteDetectorMutation} from 'sentry/views/detectors/hooks/useDeleteDetectorMutation'; import { - makeMonitorBasePathname, makeMonitorDetailsPathname, + makeMonitorTypePathname, } from 'sentry/views/detectors/pathnames'; import {detectorTypeIsUserCreateable} from 'sentry/views/detectors/utils/detectorTypeConfig'; import {useCanEditDetector} from 'sentry/views/detectors/utils/useCanEditDetector'; @@ -106,10 +106,10 @@ export function DeleteDetectorAction({detector}: {detector: Detector}) { priority: 'danger', onConfirm: async () => { await deleteDetector(detector.id); - navigate(makeMonitorBasePathname(organization.slug)); + navigate(makeMonitorTypePathname(organization.slug, detector.type)); }, }); - }, [deleteDetector, detector.id, navigate, organization.slug]); + }, [deleteDetector, detector.id, detector.type, navigate, organization.slug]); const canEdit = useCanEditDetector({ detectorType: detector.type, diff --git a/static/app/views/detectors/edit.spec.tsx b/static/app/views/detectors/edit.spec.tsx index 36650451d16e32..c1eda6197ae26e 100644 --- a/static/app/views/detectors/edit.spec.tsx +++ b/static/app/views/detectors/edit.spec.tsx @@ -142,9 +142,9 @@ describe('DetectorEdit', () => { expect.anything() ); - // Redirect to the monitors list + // Redirect to the detector type-specific list page (metrics for MetricDetectorFixture) expect(router.location.pathname).toBe( - `/organizations/${organization.slug}/monitors/` + `/organizations/${organization.slug}/monitors/metrics/` ); });