mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-27 00:08:49 +00:00
Updating framework to meteor 3 and later
This commit is contained in:
parent
717994508a
commit
cca29bc591
58 changed files with 2332 additions and 1611 deletions
|
|
@ -9,6 +9,10 @@ UserConfig.allow({
|
|||
// if use id exists, allow insert
|
||||
return !!userId;
|
||||
},
|
||||
update: function(userId, doc){
|
||||
// if use id exists, allow insert
|
||||
return !!userId;
|
||||
},
|
||||
});
|
||||
|
||||
Meteor.methods({
|
||||
|
|
@ -16,10 +20,10 @@ Meteor.methods({
|
|||
check(pref, String);
|
||||
|
||||
if (!this.userId) {
|
||||
throw new Meteor.Error('Not able to change registration setting. Make sure you are logged in with valid system administrator credentials.');
|
||||
throw new Meteor.Error('Not able to change theme setting. Make sure you are logged in with valid system administrator credentials.');
|
||||
}
|
||||
|
||||
return UserConfig.insert({
|
||||
return UserConfig.insertAsync({
|
||||
user: this.userId,
|
||||
darkMode: pref,
|
||||
dateAdded: Date()
|
||||
|
|
@ -29,23 +33,14 @@ Meteor.methods({
|
|||
check(pref, String);
|
||||
|
||||
if (!this.userId) {
|
||||
throw new Meteor.Error('Not able to change registration setting. Make sure you are logged in with valid system administrator credentials.');
|
||||
throw new Meteor.Error('Not able to change theme setting. Make sure you are logged in with valid system administrator credentials.');
|
||||
}
|
||||
|
||||
let myConfig = UserConfig.findOne({ user: this.userId });
|
||||
if (typeof myConfig == 'undefined') {
|
||||
Meteor.call('add.darkModePref', pref, function(err, result) {
|
||||
if (err) {
|
||||
console.log(" ERROR calling the add functioin for dark mode: " + err);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
return UserConfig.update({ user: this.userId }, {
|
||||
$set: {
|
||||
darkMode: pref,
|
||||
dateUpdate: Date()
|
||||
}
|
||||
});
|
||||
}
|
||||
return UserConfig.updateAsync({ user: this.userId }, {
|
||||
$set: {
|
||||
darkMode: pref,
|
||||
dateUpdate: Date()
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue