diff --git a/src/controllers/governance.controller.js b/src/controllers/governance.controller.js index a5186c57..d6075414 100644 --- a/src/controllers/governance.controller.js +++ b/src/controllers/governance.controller.js @@ -191,3 +191,17 @@ export const setGlossary = async (req, res) => { }); } }; + +export const sync = async (req, res) => { + try { + Governance.sync(); + return res.json({ + message: 'Syncing Governance Body', + }); + } catch (error) { + res.status(400).json({ + message: 'Cant Sync Governance Body', + error: error.message, + }); + } +}; diff --git a/src/controllers/organization.controller.js b/src/controllers/organization.controller.js index 5a590bbd..a186a8b7 100644 --- a/src/controllers/organization.controller.js +++ b/src/controllers/organization.controller.js @@ -398,3 +398,17 @@ export const removeMirror = async (req, res) => { }); } }; + +export const sync = async (req, res) => { + try { + Organization.syncOrganizationMeta(); + return res.json({ + message: 'Syncing All Organizations Metadata', + }); + } catch (error) { + res.status(400).json({ + message: 'Cant All Organizations Metadata', + error: error.message, + }); + } +}; diff --git a/src/routes/v1/resources/governance.js b/src/routes/v1/resources/governance.js index 1a48a509..802eee12 100644 --- a/src/routes/v1/resources/governance.js +++ b/src/routes/v1/resources/governance.js @@ -21,6 +21,10 @@ GovernanceRouter.get('/', (req, res) => { return GovernanceController.findAll(req, res); }); +GovernanceRouter.get('/sync', (req, res) => { + return GovernanceController.sync(req, res); +}); + GovernanceRouter.get('/meta/orgList', (req, res) => { return GovernanceController.findOrgList(req, res); }); diff --git a/src/routes/v1/resources/organization.js b/src/routes/v1/resources/organization.js index 07124a28..a692fcbb 100644 --- a/src/routes/v1/resources/organization.js +++ b/src/routes/v1/resources/organization.js @@ -31,6 +31,10 @@ OrganizationRouter.get( }, ); +OrganizationRouter.get('/sync', (req, res) => { + return OrganizationController.sync(req, res); +}); + OrganizationRouter.delete('/', (req, res) => { return OrganizationController.resetHomeOrg(req, res); });