properly delete relations when deleting watch

This commit is contained in:
BroodjeAap 2022-10-03 20:26:51 +00:00
parent 35e93bbe59
commit 2552f5179b

View file

@ -57,6 +57,10 @@ func (web Web) deleteWatch(c *gin.Context) {
return return
} }
web.db.Delete(&FilterConnection{}, "watch_id = ?", id)
web.db.Delete(&FilterOutput{}, "watch_id = ?", id)
web.db.Delete(&Filter{}, "watch_id = ?", id)
web.db.Delete(&Watch{}, id) web.db.Delete(&Watch{}, id)
c.Redirect(http.StatusSeeOther, "/") c.Redirect(http.StatusSeeOther, "/")
} }