diff --git a/lib/client/deploy.js b/lib/client/deploy.js index b1eaef9..13f94da 100644 --- a/lib/client/deploy.js +++ b/lib/client/deploy.js @@ -211,7 +211,6 @@ Deployment.prototype.getOnlineDeployments = function(fn) { var deployment = this; var sid = deployment.getConfig('sid'); - request.cookie('sid=' + sid); var meIdQ = q.fcall(function() { @@ -227,6 +226,7 @@ Deployment.prototype.getOnlineDeployments = function(fn) { jar: false }, function(err, res, user) { if (err) return d.reject(err); + user = JSON.parse(user); if (!user) return d.reject(new Error("Not logged in")); d.resolve(user.id); }); @@ -239,8 +239,13 @@ Deployment.prototype.getOnlineDeployments = function(fn) { var d = q.defer(); request({ - url: deployment.api + "/apps", - qs: {owner: meId}, + url: deployment.api + "/apps?" + + JSON.stringify({ + $or: [ + {owner: meId}, + {collaborators: meId} + ] + }), headers: { 'Accept': 'application/json' } @@ -250,6 +255,13 @@ Deployment.prototype.getOnlineDeployments = function(fn) { deployments = JSON.parse(deployments); } + var config = deployment.getConfig(); + + deployments = deployments.filter(function(d) { + console.log(d); + return !config[d.name + '.deploydapp.com']; + }); + d.resolve(deployments); }); diff --git a/lib/resources/dashboard/deployments.html b/lib/resources/dashboard/deployments.html index 953d75c..21c741a 100644 --- a/lib/resources/dashboard/deployments.html +++ b/lib/resources/dashboard/deployments.html @@ -6,10 +6,12 @@