app/imports/api/user/UserCollection.js
// Updates the theme to either light or dark.
Updates the theme to either light or dark.
Updates the theme to either light or dark .
updateTheme(username) {
    const user = this._collection.findOne({ username: username });
    const id = user._id;
    if (user.theme === 'light') {
      this._collection.update(id, { $set: { theme: 'dark' } });
    } else {
      this._collection.update(id, { $set: { theme: 'light' } });
    }
  }
updateTheme ( username ) { const user = this . _collection . findOne ( { username : username } ) ; const id = user . _id ; if ( user . theme === 'light' ) { this . _collection . update ( id , { $set : { theme : 'dark' } } ) ; } else { this . _collection . update ( id , { $set : { theme : 'light' } } ) ; } }
Updates the theme to either light or dark.
Updates the theme to either light or dark .