wekan/client/components/import/trelloMembersMapper.js

17 lines
574 B
JavaScript
Raw Permalink Normal View History

import { ReactiveCache } from '/imports/reactiveCache';
export function trelloGetMembersToMap(data) {
2017-07-08 13:23:33 +01:00
// we will work on the list itself (an ordered array of objects) when a
// mapping is done, we add a 'wekan' field to the object representing the
// imported member
const membersToMap = data.members;
// auto-map based on username
2019-06-28 12:52:09 -05:00
membersToMap.forEach(importedMember => {
const wekanUser = ReactiveCache.getUser({ username: importedMember.username });
2017-07-08 13:23:33 +01:00
if (wekanUser) {
importedMember.wekanId = wekanUser._id;
}
});
return membersToMap;
}