(id uint)
| 654 | } |
| 655 | |
| 656 | func (a AlertService) DeleteAlertConfig(id uint) error { |
| 657 | _, err := alertRepo.GetConfigById(id) |
| 658 | if err != nil { |
| 659 | return err |
| 660 | } |
| 661 | usedAlerts, err := alertRepo.List(alertRepo.WithByAlertMethodContainsConfigID(id)) |
| 662 | if err != nil { |
| 663 | return err |
| 664 | } |
| 665 | if len(usedAlerts) > 0 { |
| 666 | return buserr.New("ErrAlertConfigInUse") |
| 667 | } |
| 668 | return alertRepo.DeleteAlertConfig(repo.WithByID(id)) |
| 669 | } |
| 670 | |
| 671 | func (a AlertService) TestAlertConfig(req dto.AlertConfigTest) (bool, error) { |
| 672 | username := req.UserName |
nothing calls this directly
no test coverage detected