(w http.ResponseWriter, r *http.Request)
| 215 | } |
| 216 | |
| 217 | func (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 | |
| 235 | func (h *handler) createUser(w http.ResponseWriter, r *http.Request) { |
| 236 | var u UserReq |
nothing calls this directly
no test coverage detected