@@ -18,6 +18,7 @@ package client
18
18
19
19
import (
20
20
"bytes"
21
+ "context"
21
22
"encoding/json"
22
23
"errors"
23
24
"fmt"
@@ -271,23 +272,28 @@ func (impl *EventRESTClientImpl) sendEvent(event Event) (bool, error) {
271
272
// destination Url for v2
272
273
destinationUrl = impl .config .DestinationURL + "/v2"
273
274
// Get NotificationSettings from event
274
- notificationSettings , err := impl .notificationSettingsRepository .FindNotificationSettingsByEvent (
275
- event .PipelineType ,
276
- event .PipelineId ,
275
+ req := repository.GetRulesRequest {
276
+ TeamId : event .TeamId ,
277
+ EnvId : event .EnvId ,
278
+ AppId : event .AppId ,
279
+ PipelineId : event .PipelineId ,
280
+ PipelineType : event .PipelineType ,
281
+ IsProdEnv : & event .IsProdEnv ,
282
+ ClusterId : event .ClusterId ,
283
+ EnvIdsForCiPipeline : event .EnvIdsForCiPipeline ,
284
+ }
285
+ // Get NotificationSettings from event
286
+ notificationSettings , err := impl .notificationSettingsRepository .FindNotificationSettingsWithRules (
287
+ context .Background (),
277
288
event .EventTypeId ,
278
- event .AppId ,
279
- event .EnvId ,
280
- event .TeamId ,
281
- event .ClusterId ,
282
- event .IsProdEnv ,
283
- event .EnvIdsForCiPipeline ,
289
+ req ,
284
290
)
285
291
if err != nil {
286
292
impl .logger .Errorw ("error while fetching notification settings" , "err" , err )
287
293
return false , err
288
294
}
289
295
290
- // convert notificationSetting to notificationSettingbean
296
+ // convert notificationSetting to notificationSettingsBean
291
297
notificationSettingsBean := make ([]* repository.NotificationSettingsBean , 0 )
292
298
for _ , item := range notificationSettings {
293
299
config := make ([]repository.ConfigEntry , 0 )
0 commit comments