feat(user): delete GetMe endpoint

This commit is contained in:
Vyacheslav1557 2025-02-25 20:06:52 +05:00
parent 7b8d15a2c9
commit a7f2299f3f
2 changed files with 0 additions and 19 deletions

View file

@ -14,7 +14,6 @@ type UserHandlers interface {
Verify(c *fiber.Ctx) error
ListUsers(c *fiber.Ctx, params userv1.ListUsersParams) error
CreateUser(c *fiber.Ctx) error
GetMe(c *fiber.Ctx) error
DeleteUser(c *fiber.Ctx, id int32) error
GetUser(c *fiber.Ctx, id int32) error
UpdateUser(c *fiber.Ctx, id int32) error

View file

@ -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 {
const op = "UserHandlers.GetUser"