MCPcopy Create free account
hub / github.com/dhij/ecomm / deleteOrder

Method deleteOrder

ecomm-api/handler/handler.go:217–233  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

215}
216
217func (h *handler) deleteOrder(w http.ResponseWriter, r *http.Request) {
218 id := chi.URLParam(r, "id")
219 i, err := strconv.ParseInt(id, 10, 64)
220 if err != nil {
221 panic(err)
222 }
223
224 _, err = h.client.DeleteOrder(h.ctx, &pb.OrderReq{
225 Id: i,
226 })
227 if err != nil {
228 http.Error(w, "internal server error", http.StatusInternalServerError)
229 return
230 }
231
232 w.WriteHeader(http.StatusNoContent)
233}
234
235func (h *handler) createUser(w http.ResponseWriter, r *http.Request) {
236 var u UserReq

Callers

nothing calls this directly

Calls 1

DeleteOrderMethod · 0.65

Tested by

no test coverage detected