Skip to content

Conversation

@saniok017
Copy link
Collaborator

check if data is from the telegram

}
if (+new Date() - user.auth_date > 86400) {

if (+new Date() / 1000 - user.auth_date > 86400) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

86400 претендует на константу или даже сеттинг

})
.catch(err => console.log(err));
});
let { department } = user || null;
Copy link
Collaborator

Choose a reason for hiding this comment

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

|| null избыточен, так как если department нету в user то он будет undefined что вполне ожидаемо так как undefined именно вычисляемый тип, по сути department мы вычисляем а не декларируем со значением по умолчанию null

.all(dataValidation)
.post((req, res) => {
const reqUser = req.body;
const DBController = new ClassDBController('user', 'department');
Copy link
Collaborator

Choose a reason for hiding this comment

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

В этом месте лучше подойдет нэйминг вида userDBController вместо DBController так далее в программе будет понятней что мы оперируем не каким то супер контролером всех сущностей

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

лучше использовать развернутое описание

userDepartmentDBController

или достаточно

userDBController ❓

@saniok017
Copy link
Collaborator Author

Благодарю 🙇

@saniok017 saniok017 requested a review from artur-code June 16, 2019 20:52
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.

2 participants