// GetUserByID allows to retrieve a user by its id
GetUserByID allows to retrieve a user by its id
// GetUserByID allows to retrieve a user by its id
func (db *Postgres) GetUserByID(id string) (*models.User, error) {
	var user models.User
	if err := db.Where("id = ?", id).First(&user).Error; err != nil {
		return nil, helpers.NewError(http.StatusNotFound, "user_not_found", "could not find the user", err)
	}
	return &user, nil
}
func ( db * Postgres ) GetUserByID ( id string ) ( * models . User , error ) { var user models . User if err := db . Where ( " " , id ) . First ( & user ) . Error ; err != nil { return nil , helpers . NewError ( http . StatusNotFound , " " , " " , err ) } return & user , nil }
GetUserByID allows to retrieve a user by its id
GetUserByID allows to retrieve a user by its id