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';
BlazeComponent.extendComponent({
onCreated() {
this.rulesCurrentTab = new ReactiveVar('rulesList');
@ -55,7 +57,7 @@ BlazeComponent.extendComponent({
let trigger = this.triggerVar.get();
trigger.userId = '*';
if (username !== undefined) {
const userFound = Users.findOne({ username });
const userFound = ReactiveCache.getUser({ username });
if (userFound !== undefined) {
trigger.userId = userFound._id;
this.triggerVar.set(trigger);