mirror of
https://github.com/nezhahq/nezha.git
synced 2025-01-22 20:58:14 -05:00
⚡️ improve: 删除服务时删除历史数据
This commit is contained in:
parent
7df63939d2
commit
4b6740e6e0
@ -67,6 +67,9 @@ func (ma *memberAPI) delete(c *gin.Context) {
|
||||
}
|
||||
case "monitor":
|
||||
err = dao.DB.Delete(&model.Monitor{}, "id = ?", id).Error
|
||||
if err == nil {
|
||||
err = dao.DB.Delete(&model.MonitorHistory{}, "monitor_id = ?", id).Error
|
||||
}
|
||||
case "alert-rule":
|
||||
err = dao.DB.Delete(&model.AlertRule{}, "id = ?", id).Error
|
||||
if err == nil {
|
||||
|
Loading…
Reference in New Issue
Block a user