diff --git a/assets/src/utils/api.js b/assets/src/utils/api.js index 2c93f7ae..04fff2cd 100644 --- a/assets/src/utils/api.js +++ b/assets/src/utils/api.js @@ -314,7 +314,11 @@ export function newUser (user) { } } request.onerror = (error) => reject(error) - request.send(JSON.stringify(user)) + request.send(JSON.stringify({ + what: 'user', + which: 'new', + data: user + })) }) } diff --git a/users.go b/users.go index 3fda96af..9fc5675f 100644 --- a/users.go +++ b/users.go @@ -197,7 +197,7 @@ func usersPostHandler(c *RequestContext, w http.ResponseWriter, r *http.Request) c.FM.Users[u.Username] = u // Set the Location header and return. - w.Header().Set("Location", "/users/"+strconv.Itoa(u.ID)) + w.Header().Set("Location", "/settings/users/"+strconv.Itoa(u.ID)) w.WriteHeader(http.StatusCreated) return 0, nil }