improv api, datastore, postgres, runner

This commit is contained in:
Pedro Nasser
2016-07-21 21:18:02 -03:00
parent 154fd82b68
commit 5a13e2c0cc
10 changed files with 215 additions and 127 deletions

View File

@@ -9,7 +9,7 @@ import (
)
func handleAppUpdate(c *gin.Context) {
store := c.MustGet("store").(models.Datastore)
// store := c.MustGet("store").(models.Datastore)
log := c.MustGet("log").(logrus.FieldLogger)
app := &models.App{}
@@ -21,14 +21,14 @@ func handleAppUpdate(c *gin.Context) {
return
}
app.Name = c.Param("app")
// app.Name = c.Param("app")
app, err = store.StoreApp(app)
if err != nil {
log.WithError(err).Debug(models.ErrAppsUpdate)
c.JSON(http.StatusInternalServerError, simpleError(models.ErrAppsUpdate))
return
}
// app, err = store.StoreApp(app)
// if err != nil {
// log.WithError(err).Debug(models.ErrAppsUpdate)
// c.JSON(http.StatusInternalServerError, simpleError(models.ErrAppsUpdate))
// return
// }
c.JSON(http.StatusOK, app)
c.JSON(http.StatusOK, simpleError(models.ErrAppNothingToUpdate))
}