mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
* 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
23 lines
350 B
Go
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, "")
|
|
}
|