(w http.ResponseWriter, r *http.Request)
| 24 | ) |
| 25 | |
| 26 | func (h *handler) DeletePackage(w http.ResponseWriter, r *http.Request) { |
| 27 | contextInfo := request.ArtifactInfoFrom(r.Context()) |
| 28 | info, ok := contextInfo.(npm.ArtifactInfo) |
| 29 | if !ok { |
| 30 | h.HandleErrors2(r.Context(), errcode.ErrCodeInvalidRequest.WithMessage("failed to fetch info from context"), w) |
| 31 | return |
| 32 | } |
| 33 | |
| 34 | response := h.controller.DeletePackage(r.Context(), info) |
| 35 | if !commons.IsEmpty(response.GetError()) { |
| 36 | http.Error(w, response.GetError().Error(), http.StatusInternalServerError) |
| 37 | return |
| 38 | } |
| 39 | w.WriteHeader(http.StatusNoContent) |
| 40 | } |
nothing calls this directly
no test coverage detected