HandleDeleteUser handles the `DELETE /users/:id` request.
(c web.C, w http.ResponseWriter, r *http.Request)
| 100 | |
| 101 | // HandleDeleteUser handles the `DELETE /users/:id` request. |
| 102 | func (s *Server) HandleDeleteUser(c web.C, w http.ResponseWriter, r *http.Request) { |
| 103 | err := s.Store.Delete(fmt.Sprintf("/users/%s", c.URLParams["id"])) |
| 104 | if err != nil { |
| 105 | s.logger.Printf("ERROR: %s", err) |
| 106 | http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError) |
| 107 | return |
| 108 | } |
| 109 | w.WriteHeader(http.StatusNoContent) |
| 110 | } |