mirror of
https://github.com/grafana/grafana.git
synced 2024-11-26 19:00:54 -06:00
fix: alert list pause/start toggle was not working properly
This commit is contained in:
parent
6a73205b18
commit
f3a66ecbcb
@ -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 = '';
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user