diff --git a/src/management/ActionsManager.js b/src/management/ActionsManager.js index 218419419..0d80f8022 100644 --- a/src/management/ActionsManager.js +++ b/src/management/ActionsManager.js @@ -531,6 +531,7 @@ class ActionsManager { * @param {object} params Action parameters. * @param {string} params.id Action ID. * @param {string} params.version_id Action ID. + * @param {boolean} params.update_draft Update draft * @param {Function} [cb] Callback function. * @returns {Promise|undefined} */ @@ -542,11 +543,18 @@ class ActionsManager { delete params.action_id; } + const body = {}; + + if (params.update_draft) { + body.update_draft = params.update_draft; + delete params.update_draft; + } + if (cb && cb instanceof Function) { - return this.actionVersionDeploy.create(params, {}, cb); + return this.actionVersionDeploy.create(params, body, cb); } - return this.actionVersionDeploy.create(params, {}); + return this.actionVersionDeploy.create(params, body); } /** diff --git a/test/management/actions.tests.js b/test/management/actions.tests.js index db85bcfd6..0a289f931 100644 --- a/test/management/actions.tests.js +++ b/test/management/actions.tests.js @@ -734,7 +734,7 @@ describe('ActionsManager', () => { it('should perform a post request', function (done) { const { request } = this; - this.actions.deployVersion({ action_id, version_id }).then(() => { + this.actions.deployVersion({ action_id, version_id, update_draft: true }).then(() => { expect(request.isDone()).to.be.true; done();