Files
fn-serverless/api/server/fns_delete.go
Rik Gibson 64fb6d27b4 Fixed up a couple of incorrect response codes (#1095)
* Fixed up a couple of incorrect response codes

* Standardise all entities on 204 with no return content on successful delete

* Fix failing Fn.delete() test
2018-06-26 18:17:47 +01:00

23 lines
350 B
Go

package server
import (
"net/http"
"github.com/fnproject/fn/api"
"github.com/gin-gonic/gin"
)
func (s *Server) handleFnDelete(c *gin.Context) {
ctx := c.Request.Context()
fnID := c.Param(api.ParamFnID)
err := s.datastore.RemoveFn(ctx, fnID)
if err != nil {
handleErrorResponse(c, err)
return
}
c.String(http.StatusNoContent, "")
}