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

Support Paginated Relations #119

Open
Chilinot opened this issue Sep 23, 2019 · 5 comments
Open

Support Paginated Relations #119

Chilinot opened this issue Sep 23, 2019 · 5 comments

Comments

@Chilinot
Copy link
Contributor

The api im querying returns paginated lists when accessing related resources. It would be nice to have some simple getters for accessing the next and previous page similar to how normal resources work.

@CodingItWrong
Copy link
Contributor

Do the loadPage action and page getter meet those needs? https://vuex.reststate.codingitwrong.com/reading-data.html#loadpage-action-page-getter

@Chilinot
Copy link
Contributor Author

I dont think so. I currently have a resource A that has a has_many relation to resource B.
Using B/loadRelated with A as parent will fetch all related resources. But there is no info regarding pages stored to the vuex store.

In order to use B/loadPage i would have to write functionality in my backend for filtering based on relationship in the index function of B. Considering the functionality is already there for querying those resources using the relationship links returned by A it seems redundant from the view of the backend.

It would be nice to have a B/loadRelatedPage or something similar.

@tachigami
Copy link

Any updates? This is the most expected feature.
It is much easer to get paginated comments by /posts/1/comments?page[size]=10 with posts/loadRelated but it's unable to get next page this way.

@CodingItWrong
Copy link
Contributor

@TeroBlaZe I don't have availability to work on this right now. If you'd like to implement it, I'd be happy to review the PR.

@CodingItWrong
Copy link
Contributor

FYI, this library will be unmaintained going forward.

If you need new features or fixes, I recommend forking the repo and making changes, or finding an alternate library that meets your needs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants