Delete teleinfo data when deleting a teleinfo sensor
This commit is contained in:
parent
75b320680f
commit
784ebdee22
|
|
@ -103,6 +103,7 @@ func (c *SensorsController) PostCompteur() {
|
||||||
} else if isDelete != "" {
|
} else if isDelete != "" {
|
||||||
cpt := teleinfo.GetCompteurByAdresse(adresse)
|
cpt := teleinfo.GetCompteurByAdresse(adresse)
|
||||||
teleinfo.DeleteCompteur(cpt.Id)
|
teleinfo.DeleteCompteur(cpt.Id)
|
||||||
|
teleinfo.DeleteDataCompteur(cpt.AdresseCompteur)
|
||||||
c.Redirect("/sensors", 302)
|
c.Redirect("/sensors", 302)
|
||||||
} else {
|
} else {
|
||||||
c.Redirect("/404", 404)
|
c.Redirect("/404", 404)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue