Started to work the shortcodes
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"reflect"
|
||||
"strings"
|
||||
@@ -24,15 +23,7 @@ type UpdateUserArgs struct {
|
||||
|
||||
func HandleUpdateUser(w http.ResponseWriter, r *http.Request) {
|
||||
var updateArgs UpdateUserArgs
|
||||
body, err := io.ReadAll(r.Body)
|
||||
if err != nil {
|
||||
core.JSONError{
|
||||
Status: core.Error,
|
||||
Message: err.Error(),
|
||||
}.Respond(w, http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
err = json.Unmarshal(body, &updateArgs)
|
||||
err := json.NewDecoder(r.Body).Decode(&updateArgs)
|
||||
if err != nil {
|
||||
core.JSONError{
|
||||
Status: core.Error,
|
||||
|
||||
Reference in New Issue
Block a user