Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add ability to call useGetList without pagination, sort, or filter params #6056

Merged
merged 1 commit into from
Mar 18, 2021

Conversation

fzaninotto
Copy link
Member

@fzaninotto fzaninotto commented Mar 18, 2021

Problem

useGetList requires that users pass sort, pagination, and filter params. It's cumbersome.

Solution

Use sensible defaults

-const { ids, data, loaded } = useGetList('posts', { page: 1, perPage: 25 }, { field: 'id', order: 'DESC' }, {});
+const { ids, data, loaded } = useGetList('posts');

@fzaninotto fzaninotto added the RFR Ready For Review label Mar 18, 2021
@djhi djhi added this to the 3.14 milestone Mar 18, 2021
Copy link
Collaborator

@djhi djhi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@djhi djhi merged commit 34155fc into next Mar 18, 2021
@djhi djhi deleted the usegetlist-default branch March 18, 2021 11:28
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants