wekan/client/components/import/trelloMembersMapper.js
Lauri Ojansivu faad739f97 Fix Trello import.
Thanks to elct9620 and xet7 !

Fixes #3330
2020-11-04 17:51:17 +02:00

14 lines
509 B
JavaScript

export function trelloGetMembersToMap(data) {
// 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
membersToMap.forEach(importedMember => {
const wekanUser = Users.findOne({ username: importedMember.username });
if (wekanUser) {
importedMember.wekanId = wekanUser._id;
}
});
return membersToMap;
}