Skip to content

Commit

Permalink
management: Merge pull request #83 from udistrital/feature/fix_delete…
Browse files Browse the repository at this point in the history
…_cuenta

fix: ajuste respuesta de error
  • Loading branch information
AlexFBP authored Jun 15, 2022
2 parents 07f4aac + 86288aa commit ff08955
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions controllers/nodo_cuenta_contable.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package controllers

import (
"encoding/json"
"net/http"

"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
Expand Down Expand Up @@ -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()
}

0 comments on commit ff08955

Please sign in to comment.