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:
Thomas Williams 2025-09-13 04:10:59 +12:00
commit 4783ee7fe9
1 changed files with 5 additions and 8 deletions

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)
}