get owner id when setting alias
This commit is contained in:
parent
a4bdeb9cde
commit
8216aee8c4
10
cloudron.js
10
cloudron.js
@ -160,7 +160,6 @@ Cloudron.prototype.waitForApp = function (appId, version) {
|
||||
return res.body;
|
||||
};
|
||||
|
||||
|
||||
Cloudron.prototype.waitForBox = function () {
|
||||
process.stdout.write('Waiting for box.');
|
||||
var res;
|
||||
@ -353,8 +352,13 @@ Cloudron.prototype.addUser = function (username, email) {
|
||||
return res.body;
|
||||
};
|
||||
|
||||
Cloudron.prototype.setAliases = function (owner, aliases) {
|
||||
var res = request.put(this._origin + '/api/v1/users/' + owner.id + '/aliases')
|
||||
Cloudron.prototype.setAliases = function (aliases) {
|
||||
var res = request.get(this._origin + '/api/v1/profile').query({ access_token: this._credentials.accessToken }).end();
|
||||
common.verifyResponse2xx(res, 'Could not get profile');
|
||||
|
||||
console.log('user id is ', res.body.id);
|
||||
|
||||
res = request.put(this._origin + '/api/v1/users/' + res.body.id + '/aliases')
|
||||
.query({ access_token: this._credentials.accessToken })
|
||||
.send({ aliases: aliases })
|
||||
.end();
|
||||
|
@ -72,7 +72,7 @@ describe('Cloudron backup testing', function () {
|
||||
|
||||
// mail alias tests (do this here because alias takes sometime to propagate)
|
||||
it('can set aliases', function () {
|
||||
cloudron.setAliases(owner, ['admin', 'mail']);
|
||||
cloudron.setAliases(['admin', 'mail']);
|
||||
});
|
||||
|
||||
// mail tests as normal user
|
||||
|
Loading…
Reference in New Issue
Block a user