-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
v7 - hooks access to model + typescript definition #16851
Comments
While the model is present, it's an unintended consequence of how the |
Do you have any idea when this might happen ? |
Issue Creation Checklist
Feature Description
Describe the feature you'd like to see implemented
I'm using hooks, and I would like to access model on beforeCount. I can access to model when using beforeFind, but not on beforeCount. Also, "Property model does not exist on type FindOptions", can you add typescript definition for "model" on FindOptions ?
beforeFind : {
where: { id: 1 },
limit: 1,
model: User,
plain: true,
transaction: undefined,
connection: undefined,
hooks: true,
rejectOnEmpty: undefined
}
beforeCount : {
where: { userId: 1 },
hooks: true,
transaction: undefined,
connection: undefined,
raw: true
}
Describe why you would like this feature to be added to Sequelize
I apply automatic filtering on find requests using a static model function, and I would like to apply it also on count requests.
Is this feature dialect-specific?
Would you be willing to resolve this issue by submitting a Pull Request?
Indicate your interest in the addition of this feature by adding the 👍 reaction. Comments such as "+1" will be removed.
The text was updated successfully, but these errors were encountered: