mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
initial router tests: apps
This commit is contained in:
25
api/server/router/apps_delete.go
Normal file
25
api/server/router/apps_delete.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/Sirupsen/logrus"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/iron-io/functions/api/models"
|
||||
)
|
||||
|
||||
func handleAppDelete(c *gin.Context) {
|
||||
store := c.MustGet("store").(models.Datastore)
|
||||
log := c.MustGet("log").(logrus.FieldLogger)
|
||||
|
||||
appName := c.Param("app")
|
||||
err := store.RemoveApp(appName)
|
||||
|
||||
if err != nil {
|
||||
log.WithError(err).Debug(models.ErrAppsRemoving)
|
||||
c.JSON(http.StatusInternalServerError, simpleError(models.ErrAppsRemoving))
|
||||
return
|
||||
}
|
||||
|
||||
c.JSON(http.StatusOK, nil)
|
||||
}
|
||||
Reference in New Issue
Block a user