Commit af6e4ae9 authored by Alfredo Sumaran's avatar Alfredo Sumaran

Use map to iterate arrays

parent 0a1b1966
......@@ -44,11 +44,11 @@ export default class GroupsStore {
const orphans = [];
// Map groups to an object
for (let i = 0, len = groups.length; i < len; i += 1) {
const group = groups[i];
groups.map((group) => {
mappedGroups[group.id] = group;
mappedGroups[group.id].subGroups = {};
}
return group;
});
Object.keys(mappedGroups).map((key) => {
const currentGroup = mappedGroups[key];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment