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 deep filtering for manyWay #5536
Fix deep filtering for manyWay #5536
Conversation
Signed-off-by: Pierre Noël <pierre.noel@strapi.io>
Codecov Report
@@ Coverage Diff @@
## master #5536 +/- ##
===========================================
- Coverage 37.26% 17.50% -19.76%
===========================================
Files 60 700 +640
Lines 1959 10332 +8373
Branches 440 1688 +1248
===========================================
+ Hits 730 1809 +1079
- Misses 916 7090 +6174
- Partials 313 1433 +1120
Continue to review full report at Codecov.
|
); | ||
qb.leftJoin( | ||
`${originInfo.model.databaseName}.${assoc.tableCollectionName} AS ${joinTableAlias}`, | ||
`${joinTableAlias}.${singular(originInfo.alias)}_id`, |
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.
Two comments here:
- Test with a manyWay pointing to the same model ;)
- As it is the only change can you refactor the code a bit to avoid repetition :)
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.
Oh yeah, good catch for related
😏
Signed-off-by: Pierre Noël <pierre.noel@strapi.io>
I updated the PR. |
You should start by splitting the join columns into variables with understadable names and see how you can factor those :) |
Signed-off-by: Pierre Noël <pierre.noel@strapi.io>
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.
Looks good, just code lint to make it easier to change if necessary
Signed-off-by: Pierre Noël <pierre.noel@strapi.io>
d39af72
to
3964804
Compare
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.
LGTM, Good job ! 💯
fix #4487
Description of what you did: