Get user after edit

This commit is contained in:
Teajey 2025-09-13 01:10:10 +09:00
parent 73a91be228
commit 189719ec02
Signed by: Teajey
GPG Key ID: 970E790FE834A713
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.") 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)
} }