1
0
mirror of https://github.com/rancher/norman.git synced 2025-06-18 19:57:25 +00:00
norman/api/handler/delete.go

21 lines
344 B
Go
Raw Normal View History

2017-11-21 20:46:30 +00:00
package handler
2017-11-11 04:44:02 +00:00
import (
"net/http"
"github.com/rancher/norman/types"
)
func DeleteHandler(request *types.APIContext) error {
store := request.Schema.Store
if store != nil {
err := store.Delete(request, request.Schema, request.ID)
if err != nil {
return err
}
}
2017-11-28 21:28:25 +00:00
request.WriteResponse(http.StatusNoContent, nil)
2017-11-11 04:44:02 +00:00
return nil
}