Fix bug on api
This commit is contained in:
parent
535bd9dab5
commit
6e076bd93b
@ -314,7 +314,11 @@ export function newUser (user) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
request.onerror = (error) => reject(error)
|
request.onerror = (error) => reject(error)
|
||||||
request.send(JSON.stringify(user))
|
request.send(JSON.stringify({
|
||||||
|
what: 'user',
|
||||||
|
which: 'new',
|
||||||
|
data: user
|
||||||
|
}))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
2
users.go
2
users.go
@ -197,7 +197,7 @@ func usersPostHandler(c *RequestContext, w http.ResponseWriter, r *http.Request)
|
|||||||
c.FM.Users[u.Username] = u
|
c.FM.Users[u.Username] = u
|
||||||
|
|
||||||
// Set the Location header and return.
|
// 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)
|
w.WriteHeader(http.StatusCreated)
|
||||||
return 0, nil
|
return 0, nil
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user