Get user after edit #19

Merged
Teajey merged 2 commits from 16-allow-admin-to-rename-users into main 2025-09-13 04:10:59 +12:00
1 changed files with 5 additions and 8 deletions
Showing only changes of commit 189719ec02 - Show all commits

View File

@ -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.")
}
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")
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)
}