From 189719ec02b2b58d7f00a53b57b37b25461b4496 Mon Sep 17 00:00:00 2001 From: Teajey <21069848+Teajey@users.noreply.github.com> Date: Sat, 13 Sep 2025 01:10:10 +0900 Subject: [PATCH] Get user after edit --- http/routing/users.go | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/http/routing/users.go b/http/routing/users.go index 3f8940e..6578bcb 100644 --- a/http/routing/users.go +++ b/http/routing/users.go @@ -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) }