Skip to content
This repository has been archived by the owner on Jun 29, 2021. It is now read-only.

No isModified function or isNew property inside hooks #34

Closed
nullpixel opened this issue Sep 10, 2017 · 3 comments · Fixed by #35
Closed

No isModified function or isNew property inside hooks #34

nullpixel opened this issue Sep 10, 2017 · 3 comments · Fixed by #35

Comments

@nullpixel
Copy link

This makes hashing passwords almost impossible for me.

code to reproduce:

@pre<User>('save', function(next) {
    if (this.isModified("password") || this.isNew) {
        // errors
    }
})
@szokodiakos
Copy link
Owner

Hey thanks, an additional interface is required to make in Typegoose and one should alter the type of this on the callback function. When I will have time I will create the proper interface.

@nullpixel
Copy link
Author

Thanks! I love typegoose, by the way!

@nullpixel
Copy link
Author

Awesome! Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants