import { IInitiativeModel , IHubRequestOptions , getProp } from "@esri/hub-common" ; import { updateGroup } from "@esri/arcgis-rest-portal" ; param { object } initiativeModel param { object } teams param { IHubRequestOptions } hubRequestOptions private export function _updateTeamTags ( initiativeModel , teams , hubRequestOptions ) { let prms = Promise . resolve ( { success : true } ) ; if ( getProp ( teams , "props.followersGroupId" ) ) { const followersGroup = teams . groups . find ( ( g ) => g . id === teams . props . followersGroupId ) ; followersGroup . tags . push ( `hubInitiativeFollowers|${ initiativeModel . item . id }` ) ; prms = updateGroup ( { group : followersGroup , authentication : hubRequestOptions . authentication } ) ; } return prms ; }