Skip to content

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

Open
@marckraw

Description

@marckraw

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    pending-triage[Issue] Ticket is pending to be prioritisedv8

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions