diff --git a/controllers/nodo_cuenta_contable.go b/controllers/nodo_cuenta_contable.go index 2474428..639dd03 100644 --- a/controllers/nodo_cuenta_contable.go +++ b/controllers/nodo_cuenta_contable.go @@ -2,6 +2,7 @@ package controllers import ( "encoding/json" + "net/http" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/bson/primitive" @@ -288,8 +289,11 @@ func (c *NodoCuentaContableController) DeleteNode() { err := c.nodeCCManager.DeleteNodeByUUID(ID) if err == nil { message = "node-deleted" + c.Data["json"] = c.commonHelper.DefaultResponse(http.StatusOK, err, message) + } else { + c.Ctx.Output.SetStatus(http.StatusInternalServerError) + message = "node-deleted failed" + c.Data["json"] = c.commonHelper.DefaultResponse(http.StatusInternalServerError, err, message) } - - c.Data["json"] = c.commonHelper.DefaultResponse(200, err, message) c.ServeJSON() }