This commit is contained in:
Pedro Nasser
2016-08-01 19:23:31 -03:00
parent f9f1ffaac5
commit dfc4be9861
25 changed files with 137 additions and 160 deletions

24
api/server/apps_list.go Normal file
View File

@@ -0,0 +1,24 @@
package server
import (
"net/http"
"github.com/Sirupsen/logrus"
"github.com/gin-gonic/gin"
"github.com/iron-io/functions/api/models"
)
func handleAppList(c *gin.Context) {
log := c.MustGet("log").(logrus.FieldLogger)
filter := &models.AppFilter{}
apps, err := Api.Datastore.GetApps(filter)
if err != nil {
log.WithError(err).Debug(models.ErrAppsList)
c.JSON(http.StatusInternalServerError, simpleError(models.ErrAppsList))
return
}
c.JSON(http.StatusOK, &models.AppsWrapper{apps})
}