Open AsafShochet opened 4 years ago
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) } })
They should use linter to deal with this.
Sorry, it was a mistake.
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() }
} catch (error) { return next(error) } })