Skip to content

Commit

Permalink
api: implement delete layer route
Browse files Browse the repository at this point in the history
  • Loading branch information
jzelinskie committed Feb 24, 2016
1 parent 04c7351 commit b916fba
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions api/v1/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,21 @@ func getLayer(w http.ResponseWriter, r *http.Request, p httprouter.Params, ctx *
}
}

// add envelope
writeResponse(w, LayerEnvelope{Layer: &layer})
return writeHeader(w, http.StatusOK)
}

func deleteLayer(w http.ResponseWriter, r *http.Request, p httprouter.Params, ctx *context.RouteContext) int {
// ez
return 0
err := ctx.Store.DeleteLayer(p.ByName("layerName"))
if err == cerrors.ErrNotFound {
writeResponse(w, LayerEnvelope{Error: &Error{err.Error()}})
return writeHeader(w, http.StatusNotFound)
} else if err != nil {
writeResponse(w, LayerEnvelope{Error: &Error{err.Error()}})
return writeHeader(w, http.StatusInternalServerError)
}

return writeHeader(w, http.StatusOK)
}

func getNamespaces(w http.ResponseWriter, r *http.Request, p httprouter.Params, ctx *context.RouteContext) int {
Expand Down

0 comments on commit b916fba

Please sign in to comment.