diff --git a/backend/app/service/clam.go b/backend/app/service/clam.go index f318105f7..cb1b82a15 100644 --- a/backend/app/service/clam.go +++ b/backend/app/service/clam.go @@ -249,17 +249,15 @@ func (c *ClamService) Update(req dto.ClamUpdate) error { if err := clamRepo.Update(req.ID, upMap); err != nil { return err } - if req.AlertCount != 0 { - updateAlert := dto.CreateOrUpdateAlert{ - AlertTitle: req.AlertTitle, - AlertType: "clams", - AlertCount: req.AlertCount, - EntryID: clam.ID, - } - err := xpack.UpdateAlert(updateAlert) - if err != nil { - return err - } + updateAlert := dto.CreateOrUpdateAlert{ + AlertTitle: req.AlertTitle, + AlertType: "clams", + AlertCount: req.AlertCount, + EntryID: clam.ID, + } + err := xpack.UpdateAlert(updateAlert) + if err != nil { + return err } return nil } diff --git a/backend/app/service/cronjob.go b/backend/app/service/cronjob.go index 2f700a3c3..81dee96fa 100644 --- a/backend/app/service/cronjob.go +++ b/backend/app/service/cronjob.go @@ -316,17 +316,15 @@ func (u *CronjobService) Update(id uint, req dto.CronjobUpdate) error { if err != nil { return err } - if req.AlertCount != 0 { - updateAlert := dto.CreateOrUpdateAlert{ - AlertTitle: req.AlertTitle, - AlertType: cronModel.Type, - AlertCount: req.AlertCount, - EntryID: cronModel.ID, - } - err = xpack.UpdateAlert(updateAlert) - if err != nil { - return err - } + updateAlert := dto.CreateOrUpdateAlert{ + AlertTitle: req.AlertTitle, + AlertType: cronModel.Type, + AlertCount: req.AlertCount, + EntryID: cronModel.ID, + } + err = xpack.UpdateAlert(updateAlert) + if err != nil { + return err } return nil }