Skip to content

Commit 7e83ea3

Browse files
committed
default check
1 parent 1f5f76e commit 7e83ea3

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

pkg/notifier/SESNotificationService.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,10 @@ func (impl *SESNotificationServiceImpl) DeleteNotificationConfig(deleteReq *bean
175175
impl.logger.Errorw("found notifications using this config, cannot delete", "config", deleteReq)
176176
return fmt.Errorf(" Please delete all notifications using this config before deleting")
177177
}
178+
// check if default then dont delete
179+
if existingConfig.Default {
180+
return fmt.Errorf("default configuration cannot be deleted")
181+
}
178182
existingConfig.UpdatedOn = time.Now()
179183
existingConfig.UpdatedBy = userId
180184
//deleting slack config

pkg/notifier/beans/beans.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,6 @@ type NSDeleteRequest struct {
224224

225225
type NotificationRequest struct {
226226
UpdateType util.UpdateType `json:"updateType,omitempty"`
227-
SesConfigId int `json:"sesConfigId,omitempty"`
228227
Providers []*bean.Provider `json:"providers"`
229228
NotificationConfigRequest []*NotificationConfigRequest `json:"notificationConfigRequest" validate:"required"`
230229
}

0 commit comments

Comments
 (0)