diff options
author | Justin Reynolds <justinr1234@gmail.com> | 2019-06-28 12:52:09 -0500 |
---|---|---|
committer | Justin Reynolds <justinr1234@gmail.com> | 2019-06-28 12:56:51 -0500 |
commit | 3eb4d2c341b712268bd321173909e0a7b19a88c9 (patch) | |
tree | 25a8fcb088f3984e72a5bd3ded9e6a45376e0693 /models/watchable.js | |
parent | a0a482aa8efb3255a523de4524c8e09453d5571f (diff) | |
download | wekan-3eb4d2c341b712268bd321173909e0a7b19a88c9.tar.gz wekan-3eb4d2c341b712268bd321173909e0a7b19a88c9.tar.bz2 wekan-3eb4d2c341b712268bd321173909e0a7b19a88c9.zip |
Prettier & eslint project style update
Diffstat (limited to 'models/watchable.js')
-rw-r--r-- | models/watchable.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/models/watchable.js b/models/watchable.js index 6821f847..7dbacb59 100644 --- a/models/watchable.js +++ b/models/watchable.js @@ -1,5 +1,5 @@ // simple version, only toggle watch / unwatch -const simpleWatchable = (collection) => { +const simpleWatchable = collection => { collection.attachSchema({ watchers: { type: [String], @@ -24,8 +24,8 @@ const simpleWatchable = (collection) => { collection.mutations({ setWatcher(userId, level) { // if level undefined or null or false, then remove - if (!level) return { $pull: { watchers: userId }}; - return { $addToSet: { watchers: userId }}; + if (!level) return { $pull: { watchers: userId } }; + return { $addToSet: { watchers: userId } }; }, }); }; @@ -34,7 +34,7 @@ const simpleWatchable = (collection) => { const complexWatchOptions = ['watching', 'tracking', 'muted']; const complexWatchDefault = 'muted'; -const complexWatchable = (collection) => { +const complexWatchable = collection => { collection.attachSchema({ 'watchers.$.userId': { type: String, @@ -72,9 +72,9 @@ const complexWatchable = (collection) => { setWatcher(userId, level) { // if level undefined or null or false, then remove if (level === complexWatchDefault) level = null; - if (!level) return { $pull: { watchers: { userId }}}; + if (!level) return { $pull: { watchers: { userId } } }; const index = this.watcherIndex(userId); - if (index<0) return { $push: { watchers: { userId, level }}}; + if (index < 0) return { $push: { watchers: { userId, level } } }; return { $set: { [`watchers.${index}.level`]: level, |