Move every Users.findOne(idOrFirstObjectSelector, options) to the ReactiveCache

This commit is contained in:
Martin Filser 2023-02-04 11:16:53 +01:00
parent 68610e5066
commit 0767f50af8
17 changed files with 43 additions and 33 deletions

View file

@ -1,3 +1,5 @@
import { ReactiveCache } from '/imports/reactiveCache';
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
@ -5,7 +7,7 @@ export function trelloGetMembersToMap(data) {
const membersToMap = data.members;
// auto-map based on username
membersToMap.forEach(importedMember => {
const wekanUser = Users.findOne({ username: importedMember.username });
const wekanUser = ReactiveCache.getUser({ username: importedMember.username });
if (wekanUser) {
importedMember.wekanId = wekanUser._id;
}