|
|
@@ -4,9 +4,11 @@ const axios = require('axios');
|
|
|
|
|
|
const router = express.Router();
|
|
|
|
|
|
+const contributors = require('../../../client/js/components/StaffCredit/Contributor');
|
|
|
+
|
|
|
module.exports = (crowi) => {
|
|
|
|
|
|
- router.get('/staff-credit', async(req, res) => {
|
|
|
+ router.get('/', async(req, res) => {
|
|
|
const growiCloudUri = await crowi.configManager.getConfig('crowi', 'app:growiCloudUri');
|
|
|
if (growiCloudUri == null) {
|
|
|
return res.json({});
|
|
|
@@ -14,7 +16,11 @@ module.exports = (crowi) => {
|
|
|
const url = new URL('_api/staffCredit', growiCloudUri);
|
|
|
try {
|
|
|
const gcContributorsRes = await axios.get(url.toString());
|
|
|
- return res.apiv3(gcContributorsRes.data);
|
|
|
+ // prevent merge gcContributors to contributors more than once
|
|
|
+ if (contributors[1].sectionName !== 'GROWI-cloud') {
|
|
|
+ contributors.splice(1, 0, gcContributorsRes.data);
|
|
|
+ }
|
|
|
+ return res.apiv3({ contributors });
|
|
|
}
|
|
|
catch (err) {
|
|
|
return res.apiv3Err(err, 500);
|