// GetUserMe from id (in request)
GetUserMe from id (in request)
// GetUserMe from id ( in request )
func (UserController) GetUserMe(c *gin.Context) {
	storeUser, exists := c.Get(store.CurrentKey)
	loggedUser := storeUser.(*models.User)
	if exists {
		user, err := store.GetUserByID(c, loggedUser.ID)
		if err != nil {
			c.AbortWithError(http.StatusNotFound, helpers.ErrorWithCode("user_not_found", "The user does not exist", err))
			return
		}
		c.JSON(http.StatusOK, user.Sanitize("", "", ""))
	} else {
		c.AbortWithError(http.StatusUnauthorized, helpers.ErrorWithCode("user_not_logged", "The user does not exist", nil))
	}
}
func ( UserController ) GetUserMe ( c * gin . Context ) { storeUser , exists := c . Get ( store . CurrentKey ) loggedUser := storeUser . ( * models . User ) if exists { user , err := store . GetUserByID ( c , loggedUser . ID ) if err != nil { c . AbortWithError ( http . StatusNotFound , helpers . ErrorWithCode ( " " , " " , err ) ) return } c . JSON ( http . StatusOK , user . Sanitize ( " " , " " , " " ) ) } else { c . AbortWithError ( http . StatusUnauthorized , helpers . ErrorWithCode ( " " , " " , nil ) ) } }
GetUserMe from id (in request)
GetUserMe from id ( in request )