Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Commit

Permalink
Prevent showing global site in site list
Browse files Browse the repository at this point in the history
  • Loading branch information
p2kmgcl committed Feb 1, 2019
1 parent 6eeaa84 commit 214aa0d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion utils/get-site-groups.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/**
* Global site descriptiveName
* @type {string}
*/
const GLOBAL_SITE_DESCRIPTIVE_NAME = 'Global';

/**
* @param {Object} group Site group
* @param {string} group.descriptiveName Site group name
Expand Down Expand Up @@ -49,7 +55,9 @@ const getSiteGroups = async (api, companyId) => {
`/group/get-groups/company-id/${companyId}/parent-group-id/0/site/true`
);

return mergeStagingGroups(siteGroups, stagingGroups);
return mergeStagingGroups(siteGroups, stagingGroups).filter(
group => group.descriptiveName !== GLOBAL_SITE_DESCRIPTIVE_NAME
);
};

module.exports = getSiteGroups;

0 comments on commit 214aa0d

Please sign in to comment.