Skip to content

Commit 09e8e07

Browse files
committed
fix: enforcing no skip param for query options, removing uneccessary console statements, adding cbp to toc in readme [CAPI-2357]
1 parent a2a540e commit 09e8e07

File tree

5 files changed

+4
-3
lines changed

5 files changed

+4
-3
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
- [Configuration](#configuration)
6161
- [Reference Documentation](#reference-documentation)
6262
- [Contentful Javascript resources](#contentful-javascript-resources)
63+
- [Cursor Based Pagination](#cursor-based-pagination)
6364
- [REST API reference](#rest-api-reference)
6465
- [Versioning](#versioning)
6566
- [Reach out to us](#reach-out-to-us)

lib/common-types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ export interface BasicQueryOptions {
359359
}
360360

361361
export interface BasicCursorPaginationOptions extends Omit<BasicQueryOptions, 'skip'> {
362+
skip?: never
362363
pageNext?: string
363364
pagePrev?: string
364365
}

lib/common-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,6 @@ export function normalizeCursorPaginationResponse<T>(
9393

9494
return {
9595
...data,
96-
...(Object.keys(pages).length && { pages }),
96+
pages,
9797
}
9898
}

test/integration/asset-integration.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ describe('Asset API - Read', () => {
5959
})
6060

6161
test('returns [limit] number of items', async () => {
62-
const response = await environment.getAssetsWithCursor({ limit: 3 })
62+
const response = await environment.getAssetsWithCursor({ limit: 3})
6363

6464
expect(response.items).toHaveLength(3)
6565
expect(response.pages).toBeDefined()

test/unit/test-creators/static-entity-methods.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ export async function makeGetEntityTest(
77
{ entityType, mockToReturn, methodToTest, wrapperSuffix = '' },
88
) {
99
const { api, entitiesMock } = setup(Promise.resolve(mockToReturn))
10-
console.debug('HERE', entitiesMock[entityType])
1110
entitiesMock[entityType][`wrap${upperFirst(entityType)}${wrapperSuffix}`].mockReturnValue(
1211
mockToReturn,
1312
)

0 commit comments

Comments
 (0)