Skip to content

Commit

Permalink
fix: modifyUser with no user_id, return 404
Browse files Browse the repository at this point in the history
  • Loading branch information
JingYiJun committed Aug 3, 2024
1 parent 1066fcb commit 652e254
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apis/user/apis.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -106,7 +106,7 @@ func ModifyUser(c *fiber.Ctx) error {
return err
}

return c.JSON(&user)
return c.JSON(&newUser)
}

// ModifyCurrentUser
Expand Down

0 comments on commit 652e254

Please sign in to comment.