move finalizeCreate to scope of shareKey
This commit is contained in:
parent
2b880d322a
commit
bb1ba1dbc4
|
@ -83,15 +83,15 @@
|
||||||
return apiService.organizations.post(paidRequest).$promise;
|
return apiService.organizations.post(paidRequest).$promise;
|
||||||
}).then(finalizeCreate);
|
}).then(finalizeCreate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function finalizeCreate(result) {
|
||||||
|
$scope.model.card = null;
|
||||||
|
|
||||||
|
$analytics.eventTrack('Created Organization');
|
||||||
|
authService.addProfileOrganizationOwner(result, shareKey);
|
||||||
|
$state.go('backend.org.dashboard', { orgId: result.Id }).then(function () {
|
||||||
|
toastr.success('Your new organization is ready to go!', 'Organization Created');
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function finalizeCreate(result) {
|
|
||||||
$scope.model.card = null;
|
|
||||||
|
|
||||||
$analytics.eventTrack('Created Organization');
|
|
||||||
authService.addProfileOrganizationOwner(result, shareKey);
|
|
||||||
$state.go('backend.org.dashboard', { orgId: result.Id }).then(function () {
|
|
||||||
toastr.success('Your new organization is ready to go!', 'Organization Created');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue