mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-27 00:08:49 +00:00
Updates for async and await - still
This commit is contained in:
parent
febb36d75f
commit
706c5dc3ef
18 changed files with 220 additions and 233 deletions
|
|
@ -16,27 +16,27 @@ UserConfig.allow({
|
|||
});
|
||||
|
||||
Meteor.methods({
|
||||
'add.darkModePref' (pref) {
|
||||
async 'add.darkModePref' (pref) {
|
||||
check(pref, String);
|
||||
|
||||
if (!this.userId) {
|
||||
throw new Meteor.Error('Not able to change theme setting. Make sure you are logged in with valid system administrator credentials.');
|
||||
}
|
||||
|
||||
return UserConfig.insertAsync({
|
||||
return await UserConfig.insertAsync({
|
||||
user: this.userId,
|
||||
darkMode: pref,
|
||||
dateAdded: Date()
|
||||
});
|
||||
},
|
||||
'update.darkModePref' (pref) {
|
||||
async 'update.darkModePref' (pref) {
|
||||
check(pref, String);
|
||||
|
||||
if (!this.userId) {
|
||||
throw new Meteor.Error('Not able to change theme setting. Make sure you are logged in with valid system administrator credentials.');
|
||||
}
|
||||
|
||||
return UserConfig.updateAsync({ user: this.userId }, {
|
||||
return await UserConfig.updateAsync({ user: this.userId }, {
|
||||
$set: {
|
||||
darkMode: pref,
|
||||
dateUpdate: Date()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue