docs(api): use correct return type for the /user endpoint
(cherry picked from commit 5c1b2846a1c6a9ea3690ac03d58149c3715f04d4)
This commit is contained in:
parent
ac977f02df
commit
a5a54a40f6
@ -31,21 +31,21 @@ import (
|
|||||||
"github.com/labstack/echo/v4"
|
"github.com/labstack/echo/v4"
|
||||||
)
|
)
|
||||||
|
|
||||||
type userWithSettings struct {
|
type UserWithSettings struct {
|
||||||
user.User
|
user.User
|
||||||
Settings *UserSettings `json:"settings"`
|
Settings *UserSettings `json:"settings"`
|
||||||
DeletionScheduledAt time.Time `json:"deletion_scheduled_at"`
|
DeletionScheduledAt time.Time `json:"deletion_scheduled_at"`
|
||||||
IsLocalUser bool `json:"is_local_user"`
|
IsLocalUser bool `json:"is_local_user"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// UserShow gets all informations about the current user
|
// UserShow gets all information about the current user
|
||||||
// @Summary Get user information
|
// @Summary Get user information
|
||||||
// @Description Returns the current user object.
|
// @Description Returns the current user object with their settings.
|
||||||
// @tags user
|
// @tags user
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Security JWTKeyAuth
|
// @Security JWTKeyAuth
|
||||||
// @Success 200 {object} user.User
|
// @Success 200 {object} v1.UserWithSettings
|
||||||
// @Failure 404 {object} web.HTTPError "User does not exist."
|
// @Failure 404 {object} web.HTTPError "User does not exist."
|
||||||
// @Failure 500 {object} models.Message "Internal server error."
|
// @Failure 500 {object} models.Message "Internal server error."
|
||||||
// @Router /user [get]
|
// @Router /user [get]
|
||||||
@ -63,7 +63,7 @@ func UserShow(c echo.Context) error {
|
|||||||
return handler.HandleHTTPError(err)
|
return handler.HandleHTTPError(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
us := &userWithSettings{
|
us := &UserWithSettings{
|
||||||
User: *u,
|
User: *u,
|
||||||
Settings: &UserSettings{
|
Settings: &UserSettings{
|
||||||
Name: u.Name,
|
Name: u.Name,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user