pass backupId to clone api

This commit is contained in:
Girish Ramakrishnan 2016-10-03 14:24:57 -07:00
parent 3c4103032d
commit 13292e5aba

View File

@ -236,7 +236,9 @@ Cloudron.prototype.configureApp = function (appId, newLocation, altDomain /* opt
Cloudron.prototype.cloneApp = function (appId, newLocation, portBindings) {
portBindings = portBindings || null;
var data = { location: newLocation, password: this._credentials.password, portBindings: portBindings };
var backups = this.listAppBackups(appId);
var data = { location: newLocation, password: this._credentials.password, portBindings: portBindings, backupId: backups[0].id };
var res = request.post(this._origin + '/api/v1/apps/' + appId + '/clone').query({ access_token: this._credentials.accessToken }).send(data).end();
common.verifyResponse2xx(res, 'App could not be clone');