Skip to content
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

Subrelations broken after many to many #623

Closed
BurkhalterY opened this issue Nov 23, 2022 · 1 comment · Fixed by #625
Closed

Subrelations broken after many to many #623

BurkhalterY opened this issue Nov 23, 2022 · 1 comment · Fixed by #625
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@BurkhalterY
Copy link

Environment

(I don't use Nuxt)

Reproduction

https://codesandbox.io/s/wizardly-wood-cq6t5f?file=/src/App.vue

Describe the bug

When I use a many to many relation, I can't use a subquery to get a relation on the related model.

E.g.

If I want to get all users of all roles, and then get all posts of these users, the posts object key of the returned object is empty :

roleRepo.with("users", (query) => query.with("posts")).get()

But if I try to get posts directly from user, it works :

userRepo.with("posts").get()

Thank you for your help and sorry for my bad English !

Additional context

No response

Logs

No response

@CodeDredd CodeDredd added bug Something isn't working and removed pending triage labels Nov 25, 2022
@CodeDredd CodeDredd self-assigned this Nov 25, 2022
@CodeDredd CodeDredd added the good first issue Good for newcomers label Nov 25, 2022
CodeDredd added a commit that referenced this issue Dec 6, 2022
* fix(pinia-orm): Query constraints with nested relations in m:m relations broken (#625)

* fix(pinia-orm): Query constraints with nested relations in m:m relations broken

* refactor(pinia-orm): remove skip in test

* feat(pinia-orm): Add the option to sort case insensitive with `sortBy` (#636)

* docs(pinia-orm): Add requirements info for nuxt 2 users (#638)

* refactor(normalizr): reduce code to only used by orm (#641)

* perf(pinia-orm-659): Save hydrated models if not updated (#671)

* perf(pinia-orm-659): Save hydrated models if not updated

* refactor(pinia-orm): typo

closes #659, #623, #628
@BurkhalterY
Copy link
Author

Thank you : )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants