fix #781 - avoid unconsistent body : do not send NbDeleted on error (#812)

This commit is contained in:
Thibault "bui" Koechlin 2021-05-28 11:17:30 +02:00 committed by GitHub
parent c1c76645a7
commit bf6b791420
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -196,12 +196,11 @@ func (c *Controller) DeleteAlerts(gctx *gin.Context) {
nbDeleted, err := c.DBClient.DeleteAlertWithFilter(gctx.Request.URL.Query())
if err != nil {
c.HandleDBErrors(gctx, err)
return
}
deleteAlertsResp := models.DeleteAlertsResponse{
NbDeleted: strconv.Itoa(nbDeleted),
}
gctx.JSON(http.StatusOK, deleteAlertsResp)
return
}