Skip to content

Commit

Permalink
Send members information to impac-angular components
Browse files Browse the repository at this point in the history
  • Loading branch information
adamaziz15 committed Jan 24, 2017
1 parent b56f3b7 commit 640c211
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/app/components/impac-config/impac-config.svc.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,21 @@ angular.module 'mnoEnterpriseAngular'
return userOrgs
)

currentOrgIdPromise = MnoeOrganizations.get(MnoeOrganizations.selectedId).then(
currentOrgPromise = MnoeOrganizations.get(MnoeOrganizations.selectedId).then(
->
currentOrgId = parseInt(MnoeOrganizations.selectedId)
currentOrgMembers = MnoeOrganizations.selected.organization.members

if !currentOrgId
$log.error(err = {msg: "Unable to retrieve current organization"})
return $q.reject(err)

return currentOrgId
return { currentOrgId: currentOrgId, currentOrgMembers: currentOrgMembers }
)

$q.all([userOrgsPromise, currentOrgIdPromise]).then(
$q.all([userOrgsPromise, currentOrgPromise]).then(
(responses) ->
return {organizations: responses[0], currentOrgId: responses[1]}
return {organizations: responses[0], currentOrgId: responses[1].currentOrgId, currentOrgMembers: responses[1].currentOrgMembers }
)

return @
Expand Down

0 comments on commit 640c211

Please sign in to comment.