mirror of
https://github.com/rancher/norman.git
synced 2025-09-02 07:44:51 +00:00
Return 404 when no store is configured (not 200)
This commit is contained in:
@@ -3,14 +3,14 @@ package handler
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/rancher/norman/httperror"
|
||||
"github.com/rancher/norman/types"
|
||||
)
|
||||
|
||||
func DeleteHandler(request *types.APIContext, next types.RequestHandler) error {
|
||||
store := request.Schema.Store
|
||||
if store == nil {
|
||||
request.WriteResponse(http.StatusNoContent, nil)
|
||||
return nil
|
||||
return httperror.NewAPIError(httperror.NotFound, "no store found")
|
||||
}
|
||||
|
||||
obj, err := store.Delete(request, request.Schema, request.ID)
|
||||
|
Reference in New Issue
Block a user