From 4b6740e6e02e599bab45e4ef09bd5f32c352dffd Mon Sep 17 00:00:00 2001 From: naiba Date: Sat, 16 Jan 2021 15:05:35 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20improve:=20=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E6=9C=8D=E5=8A=A1=E6=97=B6=E5=88=A0=E9=99=A4=E5=8E=86?= =?UTF-8?q?=E5=8F=B2=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/dashboard/controller/member_api.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/dashboard/controller/member_api.go b/cmd/dashboard/controller/member_api.go index f848c51..3dd1bc4 100644 --- a/cmd/dashboard/controller/member_api.go +++ b/cmd/dashboard/controller/member_api.go @@ -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 {