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

No pagination for presets, components, component_groups, roles ? #535

Open
marckraw opened this issue Apr 16, 2023 · 9 comments
Open

No pagination for presets, components, component_groups, roles ? #535

marckraw opened this issue Apr 16, 2023 · 9 comments
Labels
pending-author [Issue] Awaiting further information or action from the issue author

Comments

@marckraw
Copy link

marckraw commented Apr 16, 2023

When making request to get all presets, (through storyblok-js-client with url: spaces/${spaceId}/presets/ there is no total field in response and also nothing in headers.

Expected Behavior

Request should return total, and page field, and should be able to pass per_page and page into params.
Example of proper pagination response, from for example datasources:

{
  data: { datasources: [ [Object], [Object], [Object], [Object], [Object] ] },
  headers: {
    'cache-control': 'max-age=0, private, must-revalidate',
    connection: 'keep-alive',
    'content-length': '913',
    'content-type': 'application/json; charset=utf-8',
    date: 'Sun, 16 Apr 2023 22:18:31 GMT',
    etag: 'W/"5fb942cd2c234891a887ee784e3dcc15"',
    'per-page': '100',
    'referrer-policy': 'strict-origin-when-cross-origin',
    server: 'nginx/1.23.3',
    total: '5',
    vary: 'Origin',
    via: '1.1 8455bcb2c0203b0c4ee93b610d75e69a.cloudfront.net (CloudFront)',
    'x-amz-cf-id': 'fWwK-6-2_dhXza2Ke7dDxIx6fBHDFXn0Xua0bwDvYkbu-1FRVSE5mg==',
    'x-amz-cf-pop': 'ZRH50-C1',
    'x-cache': 'Miss from cloudfront',
    'x-content-type-options': 'nosniff',
    'x-download-options': 'noopen',
    'x-frame-options': 'SAMEORIGIN',
    'x-permitted-cross-domain-policies': 'none',
    'x-request-id': 'baecb3f0-4de9-4166-81aa-4e5153905807',
    'x-runtime': '0.061035',
    'x-xss-protection': '1; mode=block'
  },
  perPage: 100,
  total: 5
}
!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Total pages:  1

Current Behavior

It doesnt return total and page fields, also not in headers:

{
  data: { presets: [ [Object] ] },
  headers: {
    'cache-control': 'max-age=0, private, must-revalidate',
    connection: 'keep-alive',
    'content-encoding': 'gzip',
    'content-type': 'application/json; charset=utf-8',
    date: 'Sun, 16 Apr 2023 21:47:40 GMT',
    etag: 'W/"d0f8241a16fa6bcc50a3c7fd357d12e4"',
    'referrer-policy': 'strict-origin-when-cross-origin',
    server: 'nginx/1.23.3',
    'transfer-encoding': 'chunked',
    vary: 'Accept-Encoding, Origin',
    via: '1.1 ebbd7f31e48ea8cf77f6021cdd92bf62.cloudfront.net (CloudFront)',
    'x-amz-cf-id': 'tcoxa6aZSyvB-QjHcMe6R1_cfSq8s8a4p7c0KGjI39EcIWrL8SD2Qw==',
    'x-amz-cf-pop': 'ZRH50-C1',
    'x-cache': 'Miss from cloudfront',
    'x-content-type-options': 'nosniff',
    'x-download-options': 'noopen',
    'x-frame-options': 'SAMEORIGIN',
    'x-permitted-cross-domain-policies': 'none',
    'x-request-id': '4d148cb1-48ce-456a-86f9-a3ec55690b98',
    'x-runtime': '0.016675',
    'x-xss-protection': '1; mode=block'
  }
}

Steps to Reproduce

Just make request using storyblok-js-client@^5.10.2

@marckraw
Copy link
Author

PS. same is happening for roles endpoint...

spaces/${spaceId}/space_roles/
{
  data: { space_roles: [ [Object] ] },
  headers: {
    'cache-control': 'max-age=0, private, must-revalidate',
    connection: 'keep-alive',
    'content-length': '313',
    'content-type': 'application/json; charset=utf-8',
    date: 'Sun, 16 Apr 2023 22:03:24 GMT',
    etag: 'W/"8d36361687ba4eb4873039f586f0e1a9"',
    'referrer-policy': 'strict-origin-when-cross-origin',
    server: 'nginx/1.23.3',
    vary: 'Origin',
    via: '1.1 9349ae4f82564896b96f5303b030d188.cloudfront.net (CloudFront)',
    'x-amz-cf-id': 'wKzeI0hqxrPQxrI4NA-U9xK1une_oDoFq2aA9zKYs8dkOhrCXDP3dA==',
    'x-amz-cf-pop': 'ZRH50-C1',
    'x-cache': 'Miss from cloudfront',
    'x-content-type-options': 'nosniff',
    'x-download-options': 'noopen',
    'x-frame-options': 'SAMEORIGIN',
    'x-permitted-cross-domain-policies': 'none',
    'x-request-id': 'e455ef36-6d77-4201-a5e6-d41d44254a07',
    'x-runtime': '0.030316',
    'x-xss-protection': '1; mode=block'
  }
}
!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Total pages:  NaN

@marckraw
Copy link
Author

marckraw commented Apr 16, 2023

eeeee end same for component_groups :)

spaces/${spaceId}/component_groups/
{
  data: {
    component_groups: [ [Object], [Object], [Object], [Object], [Object] ]
  },
  headers: {
    'cache-control': 'max-age=0, private, must-revalidate',
    connection: 'keep-alive',
    'content-length': '433',
    'content-type': 'application/json; charset=utf-8',
    date: 'Sun, 16 Apr 2023 22:16:14 GMT',
    etag: 'W/"7bd9f381ab8e3a1bfd2d1fac6ac9498a"',
    'referrer-policy': 'strict-origin-when-cross-origin',
    server: 'nginx/1.23.3',
    vary: 'Origin',
    via: '1.1 01ec1718bcc130455b377ec6b38ad50c.cloudfront.net (CloudFront)',
    'x-amz-cf-id': 'Z8icLvd4Wg0KgEyJtyfQ8YV4kP3ZralQd1X-nPlZCv_TNYGHV_Sn7A==',
    'x-amz-cf-pop': 'ZRH50-C1',
    'x-cache': 'Miss from cloudfront',
    'x-content-type-options': 'nosniff',
    'x-download-options': 'noopen',
    'x-frame-options': 'SAMEORIGIN',
    'x-permitted-cross-domain-policies': 'none',
    'x-request-id': '0100631a-1324-4b76-9329-1449297d9683',
    'x-runtime': '0.034203',
    'x-xss-protection': '1; mode=block'
  }
}
!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Total pages:  NaN

@marckraw
Copy link
Author

Same for all components:

spaces/${spaceId}/components/
{
  data: {
    components: [
      [Object], [Object], [Object], [Object], [Object],
      [Object], [Object], [Object], [Object], [Object],
      [Object], [Object], [Object], [Object], [Object],
      [Object], [Object], [Object], [Object], [Object],
      [Object], [Object], [Object], [Object], [Object],
      [Object], [Object], [Object], [Object], [Object],
      [Object], [Object], [Object], [Object], [Object],
      [Object], [Object], [Object], [Object], [Object],
      [Object], [Object], [Object], [Object], [Object],
      [Object], [Object], [Object], [Object], [Object],
      [Object], [Object], [Object], [Object], [Object],
      [Object], [Object], [Object], [Object], [Object],
      [Object], [Object], [Object], [Object], [Object],
      [Object], [Object], [Object], [Object], [Object],
      [Object], [Object], [Object], [Object], [Object],
      [Object], [Object], [Object], [Object], [Object],
      [Object], [Object], [Object], [Object]
    ],
    component_groups: [ [Object], [Object], [Object], [Object], [Object] ]
  },
  headers: {
    'cache-control': 'max-age=0, private, must-revalidate',
    connection: 'keep-alive',
    'content-length': '189311',
    'content-type': 'application/json; charset=utf-8',
    date: 'Sun, 16 Apr 2023 22:41:20 GMT',
    etag: 'W/"38f0c1b4b4972aa30e1176f337b9c236"',
    'referrer-policy': 'strict-origin-when-cross-origin',
    server: 'nginx/1.23.3',
    vary: 'Origin',
    via: '1.1 a4f3f56409fe4e0b42683dc15dd52ef8.cloudfront.net (CloudFront)',
    'x-amz-cf-id': 'CUNmGEm7K_RRu6Yk3a_zXD2kxPrIs6qlPMHthj11uMtbbpFbgMvxLQ==',
    'x-amz-cf-pop': 'ZRH50-C1',
    'x-cache': 'Miss from cloudfront',
    'x-content-type-options': 'nosniff',
    'x-download-options': 'noopen',
    'x-frame-options': 'SAMEORIGIN',
    'x-permitted-cross-domain-policies': 'none',
    'x-request-id': '1658ebad-3be6-4f16-9434-43ec69a14e82',
    'x-runtime': '0.094123',
    'x-xss-protection': '1; mode=block'
  }
}
!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Total pages:  NaN

@marckraw marckraw changed the title No pagination for presets ? No pagination for presets, components, component_groups, roles ? Apr 16, 2023
@marckraw
Copy link
Author

marckraw commented May 3, 2023

Any update on the pagination issue ? :)

@thiagosaife
Copy link

@marckraw We'll tackle this one.

@marckraw
Copy link
Author

@thiagosaife super cool, thank you 🙏

@alvarosabu alvarosabu added waiting-for-author pending-author [Issue] Awaiting further information or action from the issue author and removed waiting-for-author labels Aug 21, 2024
@alvarosabu
Copy link
Contributor

Hi @marckraw can you please confirm for me if this is still an issue? Thanks

@marckraw
Copy link
Author

Hi @marckraw can you please confirm for me if this is still an issue? Thanks

will try to find some time, this/next week to do proper testing - sb-mig is waiting to be updated with new storyblok-js-client for long time ;p

@alvarosabu
Copy link
Contributor

@marckraw Let me know 🙏🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending-author [Issue] Awaiting further information or action from the issue author
Projects
None yet
Development

No branches or pull requests

3 participants