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
fix(model.d): fix findAndCountAll.count type #13736
Conversation
`findAndCountAll` should only return `count` as an array when the `group` option is provided. This means in that case, `options` is no longer optional because when `options` is not provided, it's never a group count. I also rearrange `findAndCountAll` order to ensure the single count overload is applied first.
Do you plan to continue the work on this PR or why is it in draft state? |
Hi @sdepold Yes, I do want to work on in, probably over the next weekend. But if you are interested in it feel free to contribute. I think it's only the test cases are incomplete. |
The fix is done, could you help review too? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could u help to update the doc too if possible? Thx...
docs/manual/core-concepts/model-querying-finders.md
also is it posible to update the comments(JsDoc/TsDoc) for 2nd impl?
Hi @jesse23 I was trying to update the docs and I found the documentation and type for i.e. look at this implementation here Line 2052 in 5657a34
It's returning I'll prefer to keep this PR as it is and address that doc later. |
Sounds good. Looking forward to another PR |
🎉 This PR is included in version 6.12.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
* fix(model.d): fix findAndCountAll.count type `findAndCountAll` should only return `count` as an array when the `group` option is provided. This means in that case, `options` is no longer optional because when `options` is not provided, it's never a group count. I also rearrange `findAndCountAll` order to ensure the single count overload is applied first. * refactor(model): add fix type for findAllAndCount * refactor(model): tidy up type with SetRequired Co-authored-by: Sascha Depold <sdepold@users.noreply.github.com>
Pull Request Checklist
Please make sure to review and check all of these items:
npm run test
ornpm run test-DIALECT
pass with this change (including linting)?Description Of Change
findAndCountAll
should only returncount
as an array when thegroup
option is provided.This means in that case,
options
is no longer optional because whenoptions
is not provided, it's never a group count.I also rearrange
findAndCountAll
order to ensure the single count overload is applied first.Todos