saveSettings (settings, userId) {
    return new Promise((resolve, reject) => {
      const options = {
        url: 'api/user/settings',
        method: 'POST',
        data: settings,
        params: { userId }
      };

      // update user settings
      if (!userId || store.state.user.userId === userId) {
        store.commit('setUserSettings', settings);
      }

      Vue.axios(options)
        .then((response) => {
          resolve(response.data);
        }, (error) => {
          reject(error);
        });
    });
  }
Updates a user's settings
@param {object} settings   The object containing user settings
@param {string} userId     The unique identifier for a user
                           (only required if not the current user)
@returns {Promise} Promise A promise object that signals the completion
                           or rejection of the request.