From 0402cb7b27f45a771e246a613c74f764202aee38 Mon Sep 17 00:00:00 2001 From: Zeng1998 <1129142694@qq.com> Date: Mon, 28 Nov 2022 19:38:44 +0800 Subject: [PATCH] fix: no user settings returns when patch user (#622) --- server/user.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/user.go b/server/user.go index 0927091a..5adbdfd7 100644 --- a/server/user.go +++ b/server/user.go @@ -223,6 +223,14 @@ func (s *Server) registerUserRoutes(g *echo.Group) { return echo.NewHTTPError(http.StatusInternalServerError, "Failed to patch user").SetInternal(err) } + userSettingList, err := s.Store.FindUserSettingList(ctx, &api.UserSettingFind{ + UserID: userID, + }) + if err != nil { + return echo.NewHTTPError(http.StatusInternalServerError, "Failed to find userSettingList").SetInternal(err) + } + user.UserSettingList = userSettingList + c.Response().Header().Set(echo.HeaderContentType, echo.MIMEApplicationJSONCharsetUTF8) if err := json.NewEncoder(c.Response().Writer).Encode(composeResponse(user)); err != nil { return echo.NewHTTPError(http.StatusInternalServerError, "Failed to encode user response").SetInternal(err)