Skip to content

Commit b154a9e

Browse files
committed
refactoring: refactor beans
1 parent a6d51fa commit b154a9e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/notifier/NotificationConfigBuilder.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package notifier
1818

1919
import (
2020
"encoding/json"
21+
"errors"
2122
"github.com/devtron-labs/devtron/internal/sql/repository"
2223
"github.com/devtron-labs/devtron/pkg/notifier/beans"
2324
"github.com/devtron-labs/devtron/util/event"
@@ -113,6 +114,9 @@ func (impl NotificationConfigBuilderImpl) buildNotificationSetting(notificationS
113114

114115
func (impl NotificationConfigBuilderImpl) BuildNotificationSettingWithPipeline(teamId *int, envId *int, appId *int, pipelineId *int, clusterId *int, pipelineType util.PipelineType, eventTypeId int, viewId int, providers []*beans.Provider) (repository.NotificationSettings, error) {
115116

117+
if teamId == nil && appId == nil && envId == nil && pipelineId == nil && clusterId == nil {
118+
return repository.NotificationSettings{}, errors.New("no filter criteria is selected")
119+
}
116120
providersJson, err := json.Marshal(providers)
117121
if err != nil {
118122
impl.logger.Error(err)

0 commit comments

Comments
 (0)