Fix API inconsistencies (#404)

* fix api inconsistencies

* handling empty format cases

* code style
This commit is contained in:
Pedro Nasser
2016-12-07 17:16:48 -02:00
committed by GitHub
parent b990cba1df
commit 5367a3ef99
8 changed files with 42 additions and 23 deletions

View File

@@ -49,12 +49,12 @@ func handleRouteUpdate(c *gin.Context) {
}
}
_, err = Api.Datastore.UpdateRoute(ctx, wroute.Route)
route, err := Api.Datastore.UpdateRoute(ctx, wroute.Route)
if err != nil {
log.WithError(err).Debug(models.ErrRoutesUpdate)
c.JSON(http.StatusInternalServerError, simpleError(models.ErrRoutesUpdate))
return
}
c.JSON(http.StatusOK, routeResponse{"Route successfully updated", wroute.Route})
c.JSON(http.StatusOK, routeResponse{"Route successfully updated", route})
}