Could it be?
This commit is contained in:
@@ -46,11 +46,6 @@ type AddMessageResponse struct {
|
||||
// @Failure 500 {object} AddMessageResponse
|
||||
// @Router /message/new [post]
|
||||
func (m *MessageHandler) AddMessage(w http.ResponseWriter, r *http.Request) {
|
||||
if r.Method != http.MethodPost {
|
||||
http.Error(w, "Method not allowed", http.StatusMethodNotAllowed)
|
||||
return
|
||||
}
|
||||
|
||||
var req RequestAddMessage
|
||||
if err := ExtractFromRequest(r, &req); err != nil {
|
||||
http.Error(w, "Invalid JSON: "+err.Error(), http.StatusBadRequest)
|
||||
|
||||
Reference in New Issue
Block a user