Skip to content

Commit

Permalink
Merge pull request #159 from lcnetdev/hubs-stub-creation
Browse files Browse the repository at this point in the history
posting hub from main editor
  • Loading branch information
thisismattmiller authored Dec 9, 2024
2 parents 84edf05 + ae921a5 commit b66ccb7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/stores/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',


Expand Down
24 changes: 21 additions & 3 deletions src/stores/profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit b66ccb7

Please sign in to comment.