fix alert put api not verify bug (#987)

This commit is contained in:
chenxuan 2022-06-20 11:50:14 +08:00 committed by GitHub
parent 90db12b513
commit f9af916352
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -163,6 +163,10 @@ func (ar *AlertRule) Update(arf AlertRule) error {
arf.CreateBy = ar.CreateBy
arf.UpdateAt = time.Now().Unix()
err = arf.Verify()
if err != nil {
return err
}
return DB().Model(ar).Select("*").Updates(arf).Error
}