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

Updating incorrect showExtended->showExpanded property documentation #1205

Merged
merged 3 commits into from
Oct 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ Available pagination options:
| `perPage` | X | X | Number | 20 | Amount of results per request |
| `maxPages` | X | X | Number | N/A | Maximum amount of requests that should be made |
| `page` | | X | Number | N/A | Specific page to be retrieved |
| `showExtended` | | X | Boolean | false | Returns with the pagination information in addition to the data |
| `showExpanded` | | X | Boolean | false | Returns with the pagination information in addition to the data |

#### Offset Pagination

Expand Down Expand Up @@ -484,14 +484,14 @@ const api = new Gitlab({
let projects = await api.Projects.all({ maxPages: 2, perPage: 40 });
```

Additionally, if you would like to get back the pagination information, to know how many total pages there are for example, pass the option `showExtended`. If there are multiple results the pagination property will be included as shown below:
Additionally, if you would like to get back the pagination information, to know how many total pages there are for example, pass the option `showExpanded`. If there are multiple results the pagination property will be included as shown below:

```javascript
...
const { data, paginationInfo } = await api.Projects.all({
perPage:40,
maxPages:2,
showExtended: true
showExpanded: true
});
...
```
Expand Down Expand Up @@ -524,7 +524,7 @@ const { data } = await api.Projects.all({
});
```

Note that for keyset pagination, `page`, and `showExtended` are **not supported**.
Note that for keyset pagination, `page`, and `showExpanded` are **not supported**.

### Sudo

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ describe('RequestHelper.get()', () => {
});
});

it('should show the pagination information when the showExtended option is given', async () => {
it('should show the pagination information when the showExpanded option is given', async () => {
requester.get = jest.fn(({}, url, options) => mockedGetExtended(url, options));

const response = (await RequestHelper.get(service, 'test', {
Expand All @@ -176,7 +176,7 @@ describe('RequestHelper.get()', () => {
});
});

it('should not show the pagination information when the showExtended option is undefined or false', async () => {
it('should not show the pagination information when the showExpanded option is undefined or false', async () => {
requester.get = jest.fn(({}, url, options) => mockedGetExtended(url, options));

const response = (await RequestHelper.get(service, 'test', {
Expand Down