diff --git a/components/bots/bot.ts b/components/bots/bot.ts index 6541984..bd53d28 100644 --- a/components/bots/bot.ts +++ b/components/bots/bot.ts @@ -189,8 +189,11 @@ export default class Bot extends Component { // get bot latestRevision // TODO: find a better way to get the latest bot revision try { - const { response: {body: data} } = await this.helper.toPromise(this.api.botApi, - this.api.botApi.projectsProjectIdBotGet, projectId); + const { response: { body: data } } = await this.helper.toPromise( + this.api.projectApi, + this.api.projectApi.projectsProjectIdBotGet, projectId + ); + if (data.revision) { latestBotRevision = data.revision; } diff --git a/components/bots/deployment.ts b/components/bots/deployment.ts index 4e404c1..11bcd77 100644 --- a/components/bots/deployment.ts +++ b/components/bots/deployment.ts @@ -19,8 +19,11 @@ export default class Deployment { let cmsRevision: string; try { - const { response: {body: data} } = await this.helper.toPromise(this.api.botApi, - this.api.botApi.projectsProjectIdBotGet, projectId); + const { response: { body: data } } = await this.helper.toPromise( + this.api.projectApi, + this.api.projectApi.projectsProjectIdBotGet, projectId + ); + if (data.revision) { botRevision = data.revision; } diff --git a/lib/components/bots/bot.js b/lib/components/bots/bot.js index 01e24f7..451e830 100644 --- a/lib/components/bots/bot.js +++ b/lib/components/bots/bot.js @@ -188,7 +188,7 @@ class Bot extends merapi_1.Component { // get bot latestRevision // TODO: find a better way to get the latest bot revision try { - const { response: { body: data } } = yield this.helper.toPromise(this.api.botApi, this.api.botApi.projectsProjectIdBotGet, projectId); + const { response: { body: data } } = yield this.helper.toPromise(this.api.projectApi, this.api.projectApi.projectsProjectIdBotGet, projectId); if (data.revision) { latestBotRevision = data.revision; } diff --git a/lib/components/bots/deployment.js b/lib/components/bots/deployment.js index 3471637..6ce7cbb 100644 --- a/lib/components/bots/deployment.js +++ b/lib/components/bots/deployment.js @@ -23,7 +23,7 @@ class Deployment { let nluRevision; let cmsRevision; try { - const { response: { body: data } } = yield this.helper.toPromise(this.api.botApi, this.api.botApi.projectsProjectIdBotGet, projectId); + const { response: { body: data } } = yield this.helper.toPromise(this.api.projectApi, this.api.projectApi.projectsProjectIdBotGet, projectId); if (data.revision) { botRevision = data.revision; }