mirror of
https://github.com/m1k1o/neko.git
synced 2025-05-21 04:57:11 +02:00
api profile endpoint use default data.
This commit is contained in:
parent
d62acec443
commit
60910c2d37
1 changed files with 3 additions and 3 deletions
|
@ -87,12 +87,12 @@ func (api *ApiManagerCtx) Whoami(w http.ResponseWriter, r *http.Request) error {
|
||||||
func (api *ApiManagerCtx) UpdateProfile(w http.ResponseWriter, r *http.Request) error {
|
func (api *ApiManagerCtx) UpdateProfile(w http.ResponseWriter, r *http.Request) error {
|
||||||
session, _ := auth.GetSession(r)
|
session, _ := auth.GetSession(r)
|
||||||
|
|
||||||
data := &types.MemberProfile{}
|
data := session.Profile()
|
||||||
if err := utils.HttpJsonRequest(w, r, data); err != nil {
|
if err := utils.HttpJsonRequest(w, r, &data); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
err := api.sessions.Update(session.ID(), *data)
|
err := api.sessions.Update(session.ID(), data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if errors.Is(err, types.ErrSessionNotFound) {
|
if errors.Is(err, types.ErrSessionNotFound) {
|
||||||
return utils.HttpBadRequest("session does not exist")
|
return utils.HttpBadRequest("session does not exist")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue