-
-
Notifications
You must be signed in to change notification settings - Fork 11
feat: - add telegram data validation #172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: process
Are you sure you want to change the base?
Conversation
server/lib/dataValidation.js
Outdated
| } | ||
| if (+new Date() - user.auth_date > 86400) { | ||
|
|
||
| if (+new Date() / 1000 - user.auth_date > 86400) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
86400 претендует на константу или даже сеттинг
server/api/apiAuth.js
Outdated
| }) | ||
| .catch(err => console.log(err)); | ||
| }); | ||
| let { department } = user || null; |
There was a problem hiding this comment.
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
server/api/apiAuth.js
Outdated
| .all(dataValidation) | ||
| .post((req, res) => { | ||
| const reqUser = req.body; | ||
| const DBController = new ClassDBController('user', 'department'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В этом месте лучше подойдет нэйминг вида userDBController вместо DBController так далее в программе будет понятней что мы оперируем не каким то супер контролером всех сущностей
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
лучше использовать развернутое описание
userDepartmentDBController
или достаточно
userDBController ❓
|
Благодарю 🙇 |
check if data is from the telegram