viewer/vueapp/src/components/users/UserService.js
/**
   * 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.
   */
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.
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 .
saveSettings (settings, userId) {
    return new Promise((resolve, reject) => {
      const options = {
        url: 'api/user/settings',
        method: 'POST',
        data: settings,
        params: { userId: userId }
      };
      if (!userId || store.state.user.userId === userId) {
        store.commit('setUserSettings', settings);
      }
      Vue.axios(options)
        .then((response) => {
          resolve(response.data);
        }, (error) => {
          reject(error);
        });
    });
  }
saveSettings ( settings , userId ) { return new Promise ( ( resolve , reject ) => { const options = { url : 'api/user/settings' , method : 'POST' , data : settings , params : { userId : userId } } ; 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.
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 .
// update user settings