Merge pull request 'Get user after edit' (#19) from 16-allow-admin-to-rename-users into main
Reviewed-on: #19
This commit is contained in:
commit
4783ee7fe9
|
|
@ -57,14 +57,6 @@ func UserPost(app *lishwist.Session, h http.Header, r *http.Request) rsvp.Respon
|
||||||
return response.Error(http.StatusForbidden, "You cannot delete yourself.")
|
return response.Error(http.StatusForbidden, "You cannot delete yourself.")
|
||||||
}
|
}
|
||||||
|
|
||||||
user, err := lishwist.GetUserByReference(reference)
|
|
||||||
if err != nil {
|
|
||||||
return response.Error(http.StatusInternalServerError, "Failed to get user: %s", err)
|
|
||||||
}
|
|
||||||
if user == nil {
|
|
||||||
return response.Error(http.StatusNotFound, "User not found")
|
|
||||||
}
|
|
||||||
|
|
||||||
intent := r.Form.Get("intent")
|
intent := r.Form.Get("intent")
|
||||||
|
|
||||||
switch intent {
|
switch intent {
|
||||||
|
|
@ -81,5 +73,10 @@ func UserPost(app *lishwist.Session, h http.Header, r *http.Request) rsvp.Respon
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
user, err := lishwist.GetUserByReference(reference)
|
||||||
|
if err != nil {
|
||||||
|
return response.Error(http.StatusInternalServerError, "Failed to get user: %s", err)
|
||||||
|
}
|
||||||
|
|
||||||
return response.Data("", user)
|
return response.Data("", user)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue