|
|
@ -114,7 +114,7 @@ export class AnalyticService { |
|
|
|
if(data.enabled === undefined) { |
|
|
|
if(data.enabled === undefined) { |
|
|
|
throw new Error('Server didn`t return "enabled"'); |
|
|
|
throw new Error('Server didn`t return "enabled"'); |
|
|
|
} |
|
|
|
} |
|
|
|
console.log(`Try to enable alerts, got ${data.enabled as boolean}`); |
|
|
|
|
|
|
|
return data.enabled as boolean; |
|
|
|
return data.enabled as boolean; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
@ -123,7 +123,7 @@ export class AnalyticService { |
|
|
|
if(id === undefined) { |
|
|
|
if(id === undefined) { |
|
|
|
throw new Error('id is undefined'); |
|
|
|
throw new Error('id is undefined'); |
|
|
|
} |
|
|
|
} |
|
|
|
console.log(`Enable alert url:${this._backendURL + '/alerts'} id:${id} enabled:${enabled}`); |
|
|
|
|
|
|
|
return this._backendSrv.post( |
|
|
|
return this._backendSrv.post( |
|
|
|
this._backendURL + '/alerts', { id, enabled } |
|
|
|
this._backendURL + '/alerts', { id, enabled } |
|
|
|
); |
|
|
|
); |
|
|
|