reststate / reststate-vuex

Zero-configuration web service client for Vuex
https://vuex.reststate.codingitwrong.com
Other
72 stars 19 forks source link

Support Paginated Relations #119

Open Chilinot opened 5 years ago

Chilinot commented 5 years ago

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 commented 5 years ago

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

Chilinot commented 5 years ago

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 commented 4 years ago

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 commented 4 years ago

@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 commented 3 years ago

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.