Skip to content

Commit

Permalink
feat: manually syc gov data and org metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelTaylor3D committed Apr 14, 2023
1 parent 287ed22 commit 306b0fd
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/controllers/governance.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
}
};
14 changes: 14 additions & 0 deletions src/controllers/organization.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
}
};
4 changes: 4 additions & 0 deletions src/routes/v1/resources/governance.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
4 changes: 4 additions & 0 deletions src/routes/v1/resources/organization.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down

0 comments on commit 306b0fd

Please sign in to comment.