fix: get user by username api (#2034)

This commit is contained in:
boojack
2023-07-26 22:41:21 +08:00
committed by GitHub
parent 56c321aeaa
commit d8d6de9fca
10 changed files with 21 additions and 43 deletions

View File

@ -258,8 +258,9 @@ func (s *APIV1Service) registerUserRoutes(g *echo.Group) {
return c.JSON(http.StatusOK, userMessage)
})
// GET /user/:username - Get user by username.
g.GET("/user/:username", func(c echo.Context) error {
// GET /user/name/:username - Get user by username.
// NOTE: This should be moved to /api/v2/user/:username
g.GET("/user/name/:username", func(c echo.Context) error {
ctx := c.Request().Context()
username := c.Param("username")
user, err := s.Store.GetUser(ctx, &store.FindUser{Username: &username})