import { IHubRequestOptions } from "@esri/hub-common" ; import { getInitiative } from "./get" ; import { convertInitiativeToTemplate } from "./convert-initiative-to-template" ; import { getDefaultInitiativeTemplate } from "./get-default-initiative-template" ; param { string } id param { IHubRequestOptions } hubRequestOptions private export function _fetchAndConvertInitiativeToTemplate ( id , hubRequestOptions ) { return getInitiative ( id , hubRequestOptions ) . then ( model => { return convertInitiativeToTemplate ( model , hubRequestOptions ) ; } ) . catch ( _ => { return getDefaultInitiativeTemplate ( hubRequestOptions ) ; } ) ; }