-
Notifications
You must be signed in to change notification settings - Fork 9
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
use dependency injection User/LastActivity #90
Conversation
const u = await User.findOne({ _id: id }) | ||
!!u && recipients.push(id) | ||
for (const userId of recipients_ids) { | ||
const user = await userService.userRepo.findById(userId) |
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.
Can we use findByIds
and do it in a single request?
return user | ||
} | ||
|
||
async findExisted(login, email, phone) { |
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.
let's rename to findWhere
and use it like this:
findWhere({$or: [{login}]})
findWhere({$or: [{login}, {email}]})
findWhere({$or: [{login}, {email}, {phone}]})
|
||
import { ERROR_STATUES } from '../../../../constants/errors.js' | ||
|
||
class UserAuthOperation { |
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.
should it be UserAuthService
?
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.
or even this can be a part of UserService
SK-80
SK-83