mirror of
https://github.com/microsoft/TypeScript-Node-Starter.git
synced 2025-11-08 14:47:28 +00:00
Fix TS compiler error
This commit is contained in:
@@ -54,7 +54,7 @@ const userSchema = new mongoose.Schema({
|
||||
* Password hash middleware.
|
||||
*/
|
||||
userSchema.pre("save", function save(next) {
|
||||
const user = this;
|
||||
const user = this as UserDocument;
|
||||
if (!user.isModified("password")) { return next(); }
|
||||
bcrypt.genSalt(10, (err, salt) => {
|
||||
if (err) { return next(err); }
|
||||
|
||||
Reference in New Issue
Block a user