initial router tests: apps

This commit is contained in:
Pedro Nasser
2016-07-29 19:35:38 -03:00
parent 0facc5dbff
commit b319fa6b31
10 changed files with 297 additions and 4 deletions

View File

@@ -21,5 +21,25 @@ func handleAppUpdate(c *gin.Context) {
return
}
if app == nil {
log.Debug(models.ErrAppsMissingNew)
c.JSON(http.StatusBadRequest, simpleError(models.ErrAppsMissingNew))
return
}
if err := app.Validate(); err != nil {
log.Error(err)
c.JSON(http.StatusInternalServerError, simpleError(err))
return
}
// app, err := store.StoreApp(wapp.App)
// if err != nil {
// log.WithError(err).Debug(models.ErrAppsCreate)
// c.JSON(http.StatusInternalServerError, simpleError(models.ErrAppsCreate))
// return
// }
// Nothing to update right now in apps
c.JSON(http.StatusOK, simpleError(models.ErrAppsNothingToUpdate))
}