You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 ?
No, I don't have the time, and I understand that I will need to wait until someone from the community or maintainers is interested in implementing my feature.
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:
axeldvp
added
pending-approval
Bug reports that have not been verified yet, or feature requests that have not been accepted yet
type: feature
For issues and PRs. For new features. Never breaking changes.
labels
Dec 8, 2023
While the model is present, it's an unintended consequence of how the findAll method works and should not be relied upon. For global hooks (hooks used on the sequelize instance), we'll add a separate parameter that indicates on which model instance the event was triggered
ephys
removed
the
pending-approval
Bug reports that have not been verified yet, or feature requests that have not been accepted yet
label
Dec 13, 2023
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: