fix: rename incorrectly named ProjectUsers method
This commit is contained in:
@ -29,7 +29,7 @@ import (
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
// UserProject gets all information about a user
|
||||
// UserList gets all information about a list of users
|
||||
// @Summary Get users
|
||||
// @Description Search for a user by its username, name or full email. Name (not username) or email require that the user has enabled this in their settings.
|
||||
// @tags user
|
||||
@ -41,13 +41,13 @@ import (
|
||||
// @Failure 400 {object} web.HTTPError "Something's invalid."
|
||||
// @Failure 500 {object} models.Message "Internal server error."
|
||||
// @Router /users [get]
|
||||
func UserProject(c echo.Context) error {
|
||||
func UserList(c echo.Context) error {
|
||||
search := c.QueryParam("s")
|
||||
|
||||
s := db.NewSession()
|
||||
defer s.Close()
|
||||
|
||||
users, err := user.ProjectUsers(s, search, nil)
|
||||
users, err := user.ListUsers(s, search, nil)
|
||||
if err != nil {
|
||||
_ = s.Rollback()
|
||||
return handler.HandleHTTPError(err, c)
|
||||
@ -66,9 +66,9 @@ func UserProject(c echo.Context) error {
|
||||
return c.JSON(http.StatusOK, users)
|
||||
}
|
||||
|
||||
// ProjectUsersForProject returns a project with all users who have access to a project, regardless of the method the project was shared with them.
|
||||
// ListUsersForProject returns a list with all users who have access to a project, regardless of the method the project was shared with them.
|
||||
// @Summary Get users
|
||||
// @Description Projects all users (without emailadresses). Also possible to search for a specific user.
|
||||
// @Description Lists all users (without emailadresses). Also possible to search for a specific user.
|
||||
// @tags project
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
@ -80,7 +80,7 @@ func UserProject(c echo.Context) error {
|
||||
// @Failure 401 {object} web.HTTPError "The user does not have the right to see the project."
|
||||
// @Failure 500 {object} models.Message "Internal server error."
|
||||
// @Router /projects/{id}/projectusers [get]
|
||||
func ProjectUsersForProject(c echo.Context) error {
|
||||
func ListUsersForProject(c echo.Context) error {
|
||||
projectID, err := strconv.ParseInt(c.Param("project"), 10, 64)
|
||||
if err != nil {
|
||||
return handler.HandleHTTPError(err, c)
|
||||
@ -105,7 +105,7 @@ func ProjectUsersForProject(c echo.Context) error {
|
||||
}
|
||||
|
||||
search := c.QueryParam("s")
|
||||
users, err := models.ProjectUsersFromProject(s, &project, search)
|
||||
users, err := models.ListUsersFromProject(s, &project, search)
|
||||
if err != nil {
|
||||
_ = s.Rollback()
|
||||
return handler.HandleHTTPError(err, c)
|
||||
|
@ -288,7 +288,7 @@ func registerAPIRoutes(a *echo.Group) {
|
||||
|
||||
u.GET("", apiv1.UserShow)
|
||||
u.POST("/password", apiv1.UserChangePassword)
|
||||
u.GET("s", apiv1.UserProject)
|
||||
u.GET("s", apiv1.UserList)
|
||||
u.POST("/token", apiv1.RenewToken)
|
||||
u.POST("/settings/email", apiv1.UpdateUserEmail)
|
||||
u.GET("/settings/avatar", apiv1.GetUserAvatarProvider)
|
||||
@ -327,7 +327,7 @@ func registerAPIRoutes(a *echo.Group) {
|
||||
a.POST("/projects/:project", projectHandler.UpdateWeb)
|
||||
a.DELETE("/projects/:project", projectHandler.DeleteWeb)
|
||||
a.PUT("/namespaces/:namespace/projects", projectHandler.CreateWeb)
|
||||
a.GET("/projects/:project/projectusers", apiv1.ProjectUsersForProject)
|
||||
a.GET("/projects/:project/projectusers", apiv1.ListUsersForProject)
|
||||
|
||||
if config.ServiceEnableLinkSharing.GetBool() {
|
||||
projectSharingHandler := &handler.WebHandler{
|
||||
|
Reference in New Issue
Block a user