Skip to content

Commit ab70a1d

Browse files
committed
backward compatibility for notification
1 parent 8554d4c commit ab70a1d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

api/restHandler/NotificationRestHandler.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ func NewNotificationRestHandlerImpl(dockerRegistryConfig pipeline.DockerRegistry
118118
}
119119
}
120120

121+
// SaveNotificationSettings will be deprecated in future
121122
func (impl NotificationRestHandlerImpl) SaveNotificationSettings(w http.ResponseWriter, r *http.Request) {
122123
userId, err := impl.userAuthService.GetLoggedInUser(r)
123124
if userId == 0 || err != nil {
@@ -151,7 +152,7 @@ func (impl NotificationRestHandlerImpl) SaveNotificationSettings(w http.Response
151152

152153
if len(providers) != 0 {
153154
for _, provider := range providers {
154-
if provider.Destination == "smtp" || provider.Destination == "ses" {
155+
if provider.Destination == util.SMTP || provider.Destination == util.SES {
155156
if provider.Recipient == "" {
156157
userEmail, err := impl.userAuthService.GetEmailById(int32(provider.ConfigId))
157158
if err != nil {

pkg/notifier/beans/beans.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@ type NotificationRequest struct {
226226
UpdateType util.UpdateType `json:"updateType,omitempty"`
227227
Providers []*bean.Provider `json:"providers"`
228228
NotificationConfigRequest []*NotificationConfigRequest `json:"notificationConfigRequest" validate:"required"`
229-
SesConfigId int `json:"sesConfigId"`
229+
// will be deprecated in future
230+
SesConfigId int `json:"sesConfigId"`
230231
}
231232

232233
type NotificationUpdateRequest struct {

0 commit comments

Comments
 (0)