Commit cbc70601 authored by Cillian O'Ruanaidh's avatar Cillian O'Ruanaidh

Fetch stakeholder types by group.

parent 4d66e2de
......@@ -11,21 +11,16 @@ $controller = ($routeParams, $rootScope) ->
@init = (group) =>
return if @group? or !group?
#if @canAdministerGroup(group)
@group = group
@fetchStakeholderTypes()
#else
# EventBus.broadcast $rootScope, 'pageError', { status: 403 }, group
if @group?
@fetchedStakeholderTypes = _.filter Records.stakeholderTypes.collection.data, (stakeholderType) =>
stakeholderType.groupId == @group.id
else
@fetchedStakholderTypes = []
@fetchStakeholderTypes = =>
Records.stakeholderTypes.fetchByGroup(@group, @fragment)
applyLoadingFunction @, 'fetchStakeholderTypes'
# TODO: Necessary if just calling from group?
@stakeholderTypes = ->
Records.stakeholderTypes.collection.data
@fetchedStakeholderTypes
# TODO: Added similar method to groups, need both?
@hasStakeholderTypes = ->
_.any @stakeholderTypes()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment