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_delete.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 handleAppDelete(c *gin.Context) {
log := c.MustGet("log").(logrus.FieldLogger)
appName := c.Param("app")
err := Api.Datastore.RemoveApp(appName)
if err != nil {
log.WithError(err).Debug(models.ErrAppsRemoving)
c.JSON(http.StatusInternalServerError, simpleError(models.ErrAppsRemoving))
return
}
c.JSON(http.StatusOK, nil)
}