Lots of changes and additions to the project. Still early, and not usable.

This commit is contained in:
Brian McGonagill 2022-08-15 18:07:39 -05:00
parent 8636f8cf9b
commit 266dbd0856
41 changed files with 836 additions and 67 deletions

View file

@ -0,0 +1,32 @@
import { Meteor } from 'meteor/meteor';
import { Mongo } from 'meteor/mongo';
import { check } from 'meteor/check';
export const UserConfigOptions = new Mongo.Collection('userConfigOptions');
UserConfigOptions.allow({
insert: function(userId, doc){
// if use id exists, allow insert
return !!userId;
},
});
Meteor.methods({
'add.darkPref' (darkPref) {
check(darkPref, Boolean);
return UserConfigOptions.insert({
darkPref: darkPref,
owner: this.userId
});
},
'edit.darkPref' (darkPref) {
check(darkPref, Boolean);
return UserConfigOptions.update({ owner: this.userId }, {
$set: {
darkPref: darkPref
}
});
},
});