feat(user): delete GetMe endpoint
This commit is contained in:
parent
7b8d15a2c9
commit
a7f2299f3f
2 changed files with 0 additions and 19 deletions
|
@ -14,7 +14,6 @@ type UserHandlers interface {
|
||||||
Verify(c *fiber.Ctx) error
|
Verify(c *fiber.Ctx) error
|
||||||
ListUsers(c *fiber.Ctx, params userv1.ListUsersParams) error
|
ListUsers(c *fiber.Ctx, params userv1.ListUsersParams) error
|
||||||
CreateUser(c *fiber.Ctx) error
|
CreateUser(c *fiber.Ctx) error
|
||||||
GetMe(c *fiber.Ctx) error
|
|
||||||
DeleteUser(c *fiber.Ctx, id int32) error
|
DeleteUser(c *fiber.Ctx, id int32) error
|
||||||
GetUser(c *fiber.Ctx, id int32) error
|
GetUser(c *fiber.Ctx, id int32) error
|
||||||
UpdateUser(c *fiber.Ctx, id int32) error
|
UpdateUser(c *fiber.Ctx, id int32) error
|
||||||
|
|
|
@ -168,24 +168,6 @@ func (h *UserHandlers) CreateUser(c *fiber.Ctx) error {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *UserHandlers) GetMe(c *fiber.Ctx) error {
|
|
||||||
const op = "UserHandlers.GetMe"
|
|
||||||
|
|
||||||
token, ok := c.Locals(TokenKey).(*models.JWT)
|
|
||||||
if !ok {
|
|
||||||
return c.SendStatus(fiber.StatusUnauthorized)
|
|
||||||
}
|
|
||||||
|
|
||||||
user, err := h.userUC.ReadUserById(c.Context(), token.UserId)
|
|
||||||
if err != nil {
|
|
||||||
return c.SendStatus(pkg.ToREST(err))
|
|
||||||
}
|
|
||||||
|
|
||||||
return c.JSON(map[string]interface{}{
|
|
||||||
"user": user,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
func (h *UserHandlers) GetUser(c *fiber.Ctx, id int32) error {
|
func (h *UserHandlers) GetUser(c *fiber.Ctx, id int32) error {
|
||||||
const op = "UserHandlers.GetUser"
|
const op = "UserHandlers.GetUser"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue