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

Set default page limit on the resource #381

Open
wgator opened this issue Feb 25, 2018 · 1 comment
Open

Set default page limit on the resource #381

wgator opened this issue Feb 25, 2018 · 1 comment

Comments

@wgator
Copy link

wgator commented Feb 25, 2018

We're using this option to control the size of the page when its not explicitly passed through request params, setting it as an additional resource option:

jsonApi.define({
  namespace: 'json:api',
  resource: 'media',
  pageDefaults: {
    limit: 100
  },
  ...
})

This of course could be achieved on the handlers, but I think makes sense let this be a resource option since a private default value is already being applied by the pagination.validatePaginationParams method.

The implementation is pretty straightforward, and I would be glad to match a pull request to add this option.

@paparomeo
Copy link
Contributor

It looks like a reasonable extension of the resource definition @wgator and I'd be glad to merge a PR for this functionality if you'd care to submit one.

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

2 participants