Skip to content

Conversation

@blisnec
Copy link

@blisnec blisnec commented Jul 11, 2016

No description provided.

}

let r = Math.floor(Math.random() * (n <= 0 ? 0 : n - 1));
var r = Math.floor(Math.random() * (n <= 0 ? 0 : n - 1));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

для чего?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

выдавалась ошибка при npm start, скорее всего связано с моим локальныи окружением

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

поставьте 6ю ноду, она поддерживает let и значения по умолчанию в функциях, а эти изменения отмените

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@pskucherov
Copy link
Owner

а чего файл Consultor1.js называется? давайте без 1 обойдёмся


User.createByVKId(usersModel, VK_USER_ID)
.then(function () {
User.getByVKId(usersModel, VK_USER_ID)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нам не нужно создавать нового пользователя, можно подставить любой произвольный id, userId = 'a12345678901' например

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

возможно, мне нужно перепроверить, но по моему там вопросы выбираются по реальным user_id

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

в тестовых данных нет ничего реального, тут все изолировано надо проверять

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

я могу ошибаться, но если на вход дать фейковый id юзера, то мы не получим вопросов, выборка идёт с учётом id юзера(из users)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

да, точно. Это Consultor.getAllQuestions криво написан, что завязан на пользователей :(
вопрос снимается, надо будет порефакторить.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants