Skip to content
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

Thanks for the code- and a question about the async-await usage #29

Open
AsafShochet opened this issue Sep 7, 2019 · 2 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@AsafShochet
Copy link

hi,
I found your boiler plate very helpful, thanks.

I have a question, why did you use asyn in the user.model.js file, but there's no "await" inside the function.
just curious.
for example - here:

userSchema.pre('save', async function save (next) {
try {
if (!this.isModified('password')) {
return next()
}

this.password = bcrypt.hashSync(this.password)

return next()

} catch (error) {
return next(error)
}
})

@macaframa
Copy link

They should use linter to deal with this.

@kasvith
Copy link
Owner

kasvith commented Oct 12, 2020

Sorry, it was a mistake.

@kasvith kasvith self-assigned this Oct 20, 2020
@kasvith kasvith added the bug Something isn't working label Oct 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants