fix: alert list pause/start toggle was not working properly

This commit is contained in:
Torkel Ödegaard 2018-01-11 15:12:01 +01:00
parent 6a73205b18
commit f3a66ecbcb
2 changed files with 3 additions and 3 deletions

View File

@ -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 = '';

View File

@ -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) {