Commit f3a66ecb by Torkel Ödegaard

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

parent 6a73205b
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 = '';
......
import moment from 'moment';
import moment from 'moment';
import alertDef from 'app/features/alerting/alert_def';
export function setStateFields(rule, state) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment