Small improvements
This commit is contained in:
@@ -23,14 +23,6 @@ type UpdateUserArgs struct {
|
||||
}
|
||||
|
||||
func HandleUpdateUser(w http.ResponseWriter, r *http.Request) {
|
||||
if r.Method != http.MethodPatch {
|
||||
core.JSONError{
|
||||
Status: core.Error,
|
||||
Message: "Method is not allowed.",
|
||||
}.Respond(w, http.StatusMethodNotAllowed)
|
||||
return
|
||||
}
|
||||
|
||||
var updateArgs UpdateUserArgs
|
||||
body, err := io.ReadAll(r.Body)
|
||||
if err != nil {
|
||||
@@ -94,4 +86,3 @@ func HandleUpdateUser(w http.ResponseWriter, r *http.Request) {
|
||||
Data: user,
|
||||
}.Respond(w, http.StatusOK)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user