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

@@ -41,7 +41,7 @@ func (s *Server) handleAppCreate(c *gin.Context) {
return
}
_, err = Api.Datastore.InsertApp(ctx, wapp.App)
app, err := Api.Datastore.InsertApp(ctx, wapp.App)
if err != nil {
log.WithError(err).Errorln(models.ErrAppsCreate)
c.JSON(http.StatusInternalServerError, simpleError(err))
@@ -55,5 +55,5 @@ func (s *Server) handleAppCreate(c *gin.Context) {
return
}
c.JSON(http.StatusCreated, appResponse{"App successfully created", wapp.App})
c.JSON(http.StatusCreated, appResponse{"App successfully created", app})
}