diff --git a/src/stores/config.js b/src/stores/config.js index ce2ae63c..3e9b17ab 100644 --- a/src/stores/config.js +++ b/src/stores/config.js @@ -26,8 +26,8 @@ export const useConfigStore = defineStore('config', { profiles : 'http://localhost:9401/util/profiles/profile/prod', starting: 'http://localhost:9401/util/profiles/starting/prod', - profiles: 'https://raw.githubusercontent.com/lcnetdev/bfe-profiles/main/profile-prod/data.json', - // profiles: 'https://raw.githubusercontent.com/lcnetdev/bfe-profiles/main/profile-stage/data.json', + // profiles: 'https://raw.githubusercontent.com/lcnetdev/bfe-profiles/main/profile-prod/data.json', + profiles: 'https://raw.githubusercontent.com/lcnetdev/bfe-profiles/main/profile-stage/data.json', starting: 'https://raw.githubusercontent.com/lcnetdev/bfe-profiles/main/starting-prod/data.json', diff --git a/src/stores/profile.js b/src/stores/profile.js index 2557da74..2c18cbe2 100644 --- a/src/stores/profile.js +++ b/src/stores/profile.js @@ -2639,12 +2639,30 @@ export const useProfileStore = defineStore('profile', { * @return {obj} - response from posting action */ publishRecord: async function(eid, profile){ + + + + let postingHub = false + if (this.activeProfile && this.activeProfile.id && this.activeProfile.id.indexOf(':Hub')>-1){ + // ITS A HUB! + // do other things if its a hub + postingHub=true + } + let xml = await utilsExport.buildXML(this.activeProfile) - let pubResuts = await utilsNetwork.publish(xml.xlmStringBasic, this.activeProfile.eId, this.activeProfile) - pubResuts.resourceLinks=[] - // if it was accepted by the system send it to the marva backend to store as posted + + let pubResuts + + if (postingHub){ + pubResuts = await utilsNetwork.publish(xml.xlmStringBasic, this.activeProfile.eId, {id: 'Hub'}) + }else{ + pubResuts = await utilsNetwork.publish(xml.xlmStringBasic, this.activeProfile.eId, this.activeProfile) + } + + pubResuts.resourceLinks=[] + // if it was accepted by the system send it to the marva backend to store as posted if (pubResuts.status){ this.activeProfile.status = 'published'