Skip to content

Commit 2f78963

Browse files
committed
use new sync API endpoints for job/task wait()
1 parent 8291f45 commit 2f78963

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

lib/JobsResource.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,11 @@ export default class JobsResource {
3838
}
3939

4040
async wait(id: string): Promise<Job> {
41-
const response = await this.cloudConvert.axios.get(
42-
'jobs/' + id + '/wait'
43-
);
41+
const response = await this.cloudConvert.axios.get('jobs/' + id, {
42+
baseURL: this.cloudConvert.useSandbox
43+
? 'https://sync.api.sandbox.cloudconvert.com/v2/'
44+
: 'https://sync.api.cloudconvert.com/v2/'
45+
});
4446
return response.data.data;
4547
}
4648

lib/TasksResource.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -430,9 +430,11 @@ export default class TasksResource {
430430
}
431431

432432
async wait(id: string): Promise<Task> {
433-
const response = await this.cloudConvert.axios.get(
434-
'tasks/' + id + '/wait'
435-
);
433+
const response = await this.cloudConvert.axios.get('tasks/' + id, {
434+
baseURL: this.cloudConvert.useSandbox
435+
? 'https://sync.api.sandbox.cloudconvert.com/v2/'
436+
: 'https://sync.api.cloudconvert.com/v2/'
437+
});
436438
return response.data.data;
437439
}
438440

0 commit comments

Comments
 (0)