Skip to content

Commit 6bd75da

Browse files
authored
Merge pull request #77 from FreeClimbAPI/pagination-fix
Fix pagination issue
2 parents 43fb29d + f0f5a7e commit 6bd75da

5 files changed

Lines changed: 15 additions & 11 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
99

1010
None
1111

12+
<a name="3.7.1"></a>
13+
14+
## [3.7.1] - 2024-09-12
15+
16+
### Fixed
17+
18+
- getNextPage() bug that incorrectly built url
19+
1220
<a name="3.7.0"></a>
1321

1422
## [3.7.0] - 2024-08-28

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ For more information, please visit [https://www.freeclimb.com/support/](https://
1414
## Installing
1515

1616
```sh
17-
npm install @freeclimb/sdk@3.7.0
17+
npm install @freeclimb/sdk@3.7.1
1818
or
19-
yarn add @freeclimb/sdk@3.7.0
19+
yarn add @freeclimb/sdk@3.7.1
2020
```
2121

2222
## Getting Started

__tests__/DefaultApi.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ import {AccountStatus, AccountType, CallStatus, MessageDirection, PlayBeep, SMST
77
describe('DefaultAPI', () => {
88

99
let apiInstance: freeclimb.DefaultApi
10+
const accountId = 'YOUR_ACCOUNT_ID'
1011
beforeAll(() => {
1112
const configuration = freeclimb.createConfiguration({
1213
baseServer: new ServerConfiguration<{ }>("http://127.0.0.1:4010", { }),
13-
accountId: 'YOUR_ACCOUNT_ID',
14+
accountId: accountId,
1415
apiKey: 'YOUR_API_KEY'
1516
});
1617
apiInstance = new freeclimb.DefaultApi(configuration);
@@ -464,7 +465,7 @@ describe('DefaultAPI', () => {
464465
page: 0,
465466
numPages: 0,
466467
pageSize: 0,
467-
nextPageUri: '/Recordings?cursor=1',
468+
nextPageUri: `/Accounts/${accountId}/Recordings?cursor=1`,
468469
recordings: []
469470
}
470471
const expectedResponseObject: RecordingList = {

apis/DefaultApi.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2486,14 +2486,9 @@ export class DefaultApiRequestFactory extends BaseAPIRequestFactory {
24862486

24872487
public async getNextPage<T extends PaginationModel>(responseObject: T, _options?: Configuration): Promise<RequestContext> {
24882488
const _config = _options || this.configuration;
2489-
const { accountId } = this.configuration
2490-
// Path Params
2491-
const localVarPath = `/Accounts/{accountId}${responseObject.nextPageUri}`
2492-
.replace('{' + 'accountId' + '}', encodeURIComponent(String(accountId)));
24932489
// Make Request Context
2494-
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
2490+
const requestContext = _config.baseServer.makeRequestContext(responseObject.nextPageUri!, HttpMethod.GET);
24952491
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
2496-
24972492

24982493
let authMethod: SecurityAuthentication | undefined;
24992494
// Apply auth methods

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@freeclimb/sdk",
3-
"version": "3.7.0",
3+
"version": "3.7.1",
44
"description": "OpenAPI client for @freeclimb/sdk",
55
"author": "OpenAPI-Generator Contributors",
66
"keywords": [

0 commit comments

Comments
 (0)