Move every Meteor.user() to the ReactiveCache

This commit is contained in:
Martin Filser 2023-01-16 23:00:10 +01:00
parent 6e1ef3d94a
commit 5e3a9dc059
42 changed files with 211 additions and 252 deletions

View file

@ -118,7 +118,7 @@ if (Meteor.isServer) {
orgWebsite,
orgIsActive,
) {
if (Meteor.user() && Meteor.user().isAdmin) {
if (ReactiveCache.getCurrentUser()?.isAdmin) {
check(orgDisplayName, String);
check(orgDesc, String);
check(orgShortName, String);
@ -166,7 +166,7 @@ if (Meteor.isServer) {
}
},
setOrgDisplayName(org, orgDisplayName) {
if (Meteor.user() && Meteor.user().isAdmin) {
if (ReactiveCache.getCurrentUser()?.isAdmin) {
check(org, Object);
check(orgDisplayName, String);
Org.update(org, {
@ -177,7 +177,7 @@ if (Meteor.isServer) {
},
setOrgDesc(org, orgDesc) {
if (Meteor.user() && Meteor.user().isAdmin) {
if (ReactiveCache.getCurrentUser()?.isAdmin) {
check(org, Object);
check(orgDesc, String);
Org.update(org, {
@ -187,7 +187,7 @@ if (Meteor.isServer) {
},
setOrgShortName(org, orgShortName) {
if (Meteor.user() && Meteor.user().isAdmin) {
if (ReactiveCache.getCurrentUser()?.isAdmin) {
check(org, Object);
check(orgShortName, String);
Org.update(org, {
@ -197,7 +197,7 @@ if (Meteor.isServer) {
},
setOrgIsActive(org, orgIsActive) {
if (Meteor.user() && Meteor.user().isAdmin) {
if (ReactiveCache.getCurrentUser()?.isAdmin) {
check(org, Object);
check(orgIsActive, Boolean);
Org.update(org, {
@ -238,7 +238,7 @@ if (Meteor.isServer) {
orgWebsite,
orgIsActive,
) {
if (Meteor.user() && Meteor.user().isAdmin) {
if (ReactiveCache.getCurrentUser()?.isAdmin) {
check(org, Object);
check(orgDisplayName, String);
check(orgDesc, String);