From 652e25475f5fd0426fe51491f220321bb0c21d96 Mon Sep 17 00:00:00 2001 From: Ke Chen Date: Sat, 3 Aug 2024 22:53:19 +0800 Subject: [PATCH] fix: modifyUser with no user_id, return 404 --- apis/user/apis.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apis/user/apis.go b/apis/user/apis.go index 1127b4d..a45b805 100644 --- a/apis/user/apis.go +++ b/apis/user/apis.go @@ -96,7 +96,7 @@ func ModifyUser(c *fiber.Ctx) error { } var newUser User - err = DB.Select("config").First(&newUser, userID).Error + err = DB.First(&newUser, userID).Error if err != nil { return err } @@ -106,7 +106,7 @@ func ModifyUser(c *fiber.Ctx) error { return err } - return c.JSON(&user) + return c.JSON(&newUser) } // ModifyCurrentUser