Add all plans to the map in the org admin

This commit is contained in:
Joseph Schorr 2013-11-13 18:00:51 -05:00
parent 8615e9236b
commit 51dc9c9132

View file

@ -1188,9 +1188,15 @@ function OrgAdminCtrl($rootScope, $scope, Restangular, $routeParams, UserService
PlanService.getPlans(function(plans) {
$scope.plans = plans.business;
$scope.plan_map = {};
for (var i = 0; i < plans.business.length; ++i) {
$scope.plan_map[plans.business[i].stripeId] = plans.business[i];
}
var addPlans = function(plans) {
for (var i = 0; i < plans.length; ++i) {
$scope.plan_map[plans[i].stripeId] = plans[i];
}
};
addPlans(plans.user);
addPlans(plans.business);
});
var orgname = $routeParams.orgname;