mirror of
https://github.com/rancher/norman.git
synced 2025-06-16 10:47:42 +00:00
21 lines
338 B
Go
21 lines
338 B
Go
|
package handlers
|
||
|
|
||
|
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
|
||
|
}
|
||
|
}
|
||
|
|
||
|
request.WriteResponse(http.StatusOK, nil)
|
||
|
return nil
|
||
|
}
|