Skip to content

Commit 49dbd1e

Browse files
committed
chore: updating param comment to reflect appropriate url, adding pagination example to readme [CAPI-2357]
1 parent fa0dca8 commit 49dbd1e

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,14 @@ console.log(response.pages?.next); // Cursor for next page
238238
```
239239
Use the value from `response.pages.next` to fetch the next page.
240240
241+
```js
242+
const secondPage = await environment.getEntriesWithCursor({
243+
limit: 2,
244+
pageNext: response.pages?.next,
245+
});
246+
console.log(secondPage.items); // Array of items
247+
```
248+
241249
## Legacy Client Interface
242250
243251
The following code snippet is an example of the legacy client interface, which reads and writes data as a sequence of nested requests:

lib/create-environment-api.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) {
500500

501501
/**
502502
* Gets a collection of Content Types with cursor based pagination
503-
* @param query - Object with search parameters. Check the <a href="https://www.contentful.com/developers/docs/javascript/tutorials/using-js-cda-sdk/#retrieving-entries-with-search-parameters">JS SDK tutorial</a> and the <a href="https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters">REST API reference</a> for more details.
503+
* @param query - Object with cursor pagination parameters. Check the <a href="https://www.contentful.com/developers/docs/references/content-management-api/#/introduction/cursor-pagination">REST API reference</a> for more details.
504504
* @return Promise for a collection of Content Types
505505
* @example ```javascript
506506
* const contentful = require('contentful-management')
@@ -787,7 +787,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) {
787787
* Gets a collection of Entries with cursor based pagination
788788
* Warning: if you are using the select operator, when saving, any field that was not selected will be removed
789789
* from your entry in the backend
790-
* @param query - Object with search parameters. Check the <a href="https://www.contentful.com/developers/docs/javascript/tutorials/using-js-cda-sdk/#retrieving-entries-with-search-parameters">JS SDK tutorial</a> and the <a href="https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters">REST API reference</a> for more details.
790+
* @param query - Object with cursor pagination parameters. Check the <a href="https://www.contentful.com/developers/docs/references/content-management-api/#/introduction/cursor-pagination">REST API reference</a> for more details.
791791
* @return Promise for a collection of Entries
792792
* @example ```javascript
793793
* const contentful = require('contentful-management')
@@ -1042,7 +1042,7 @@ export default function createEnvironmentApi(makeRequest: MakeRequest) {
10421042
* Gets a collection of Assets with cursor based pagination
10431043
* Warning: if you are using the select operator, when saving, any field that was not selected will be removed
10441044
* from your entry in the backend
1045-
* @param query - Object with search parameters. Check the <a href="https://www.contentful.com/developers/docs/javascript/tutorials/using-js-cda-sdk/#retrieving-entries-with-search-parameters">JS SDK tutorial</a> and the <a href="https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters">REST API reference</a> for more details.
1045+
* @param query - Object with cursor pagination parameters. Check the <a href="https://www.contentful.com/developers/docs/references/content-management-api/#/introduction/cursor-pagination">REST API reference</a> for more details.
10461046
* @return Promise for a collection of Assets
10471047
* @example ```javascript
10481048
* const contentful = require('contentful-management')

0 commit comments

Comments
 (0)