Implement code review changes
This commit is contained in:
1 parent
5c5951bc42
commit
bdf433594a
6 files changed
+33
-21
No files matched your search
@@ -148,8 +148,9 @@ func CreateAlertNotificationCommand(cmd *m.CreateAlertNotificationCommand) error
|
||||
return fmt.Errorf("Alert notification frequency required")
|
||||
}
|
||||
|
||||
frequency, err_convert := time.ParseDuration(cmd.Frequency)
|
||||
if err_convert != nil {
|
||||
var frequency time.Duration
|
||||
frequency, err = time.ParseDuration(cmd.Frequency)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -200,7 +201,7 @@ func UpdateAlertNotification(cmd *m.UpdateAlertNotificationCommand) error {
|
||||
current.NotifyOnce = cmd.NotifyOnce
|
||||
|
||||
if cmd.Frequency == "" {
|
||||
return fmt.Errorf("Alert notification frequency required")
|
||||
return m.ErrNotificationFrequencyNotFound
|
||||
}
|
||||
|
||||
frequency, err_convert := time.ParseDuration(cmd.Frequency)
|
||||
|
||||
Reference in new issue
Block a user