mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-27 00:08:49 +00:00
Updating the materialize library and calls.
This commit is contained in:
parent
a118bf38fc
commit
e44ef98be4
17 changed files with 10582 additions and 15529 deletions
42
imports/api/userConfig.js
Normal file
42
imports/api/userConfig.js
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
import { Meteor } from 'meteor/meteor';
|
||||
import { Mongo } from 'meteor/mongo';
|
||||
import { check } from 'meteor/check';
|
||||
|
||||
export const UserConfig = new Mongo.Collection('userConfig');
|
||||
|
||||
UserConfig.allow({
|
||||
insert: function(userId, doc){
|
||||
// if use id exists, allow insert
|
||||
return !!userId;
|
||||
},
|
||||
});
|
||||
|
||||
Meteor.methods({
|
||||
'add.darkModePref' (pref) {
|
||||
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.');
|
||||
}
|
||||
|
||||
return UserConfig.insert({
|
||||
user: this.userId,
|
||||
darkMode: pref,
|
||||
dateAdded: Date()
|
||||
});
|
||||
},
|
||||
'update.darkModePref' (pref) {
|
||||
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.');
|
||||
}
|
||||
|
||||
return UserConfig.update({ user: this.userId }, {
|
||||
$set: {
|
||||
darkMode: pref,
|
||||
dateUpdate: Date()
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue