From 6a8e39ba1741acba9ddef6fac5a43c2b97ddf627 Mon Sep 17 00:00:00 2001
From: Pavel Bakulev
Date: Wed, 16 Jan 2019 16:34:32 +0200
Subject: [PATCH] Added uid to AlertNotification json
---
pkg/api/dtos/alerting.go | 2 ++
public/app/features/alerting/AlertTabCtrl.ts | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/pkg/api/dtos/alerting.go b/pkg/api/dtos/alerting.go
index c037831f341..dcdc3976ec5 100644
--- a/pkg/api/dtos/alerting.go
+++ b/pkg/api/dtos/alerting.go
@@ -50,6 +50,7 @@ func formatShort(interval time.Duration) string {
func NewAlertNotification(notification *models.AlertNotification) *AlertNotification {
return &AlertNotification{
Id: notification.Id,
+ Uid: notification.Uid,
Name: notification.Name,
Type: notification.Type,
IsDefault: notification.IsDefault,
@@ -64,6 +65,7 @@ func NewAlertNotification(notification *models.AlertNotification) *AlertNotifica
type AlertNotification struct {
Id int64 `json:"id"`
+ Uid string `json:"uid"`
Name string `json:"name"`
Type string `json:"type"`
IsDefault bool `json:"isDefault"`
diff --git a/public/app/features/alerting/AlertTabCtrl.ts b/public/app/features/alerting/AlertTabCtrl.ts
index af00e79b085..d1accae6787 100644
--- a/public/app/features/alerting/AlertTabCtrl.ts
+++ b/public/app/features/alerting/AlertTabCtrl.ts
@@ -141,7 +141,7 @@ export class AlertTabCtrl {
iconClass: this.getNotificationIcon(model.type),
isDefault: false,
});
- this.alert.notifications.push({ id: model.id });
+ this.alert.notifications.push({ uid: model.uid });
// reset plus button
this.addNotificationSegment.value = this.uiSegmentSrv.newPlusButton().value;