diff --git a/public/app/stores/AlertListStore/AlertRule.ts b/public/app/stores/AlertListStore/AlertRule.ts index 63b572555cb..28a8631a59d 100644 --- a/public/app/stores/AlertListStore/AlertRule.ts +++ b/public/app/stores/AlertListStore/AlertRule.ts @@ -1,4 +1,4 @@ -import { types, getEnv, flow } from 'mobx-state-tree'; +import { types, getEnv, flow } from 'mobx-state-tree'; import { setStateFields } from './helpers'; export const AlertRule = types @@ -26,7 +26,7 @@ export const AlertRule = types */ togglePaused: flow(function* togglePaused() { const backendSrv = getEnv(self).backendSrv; - const payload = { paused: self.isPaused }; + const payload = { paused: !self.isPaused }; const res = yield backendSrv.post(`/api/alerts/${self.id}/pause`, payload); setStateFields(self, res.state); self.info = ''; diff --git a/public/app/stores/AlertListStore/helpers.ts b/public/app/stores/AlertListStore/helpers.ts index bf3c81ca11c..c460a697967 100644 --- a/public/app/stores/AlertListStore/helpers.ts +++ b/public/app/stores/AlertListStore/helpers.ts @@ -1,4 +1,4 @@ -import moment from 'moment'; +import moment from 'moment'; import alertDef from 'app/features/alerting/alert_def'; export function setStateFields(rule, state) {