common/vueapp/UserService.js
/**
   * Updates a user
   * @param {Object} user - The updated user object
   */
Updates a user
@param {Object} user - The updated user object
Updates a user @param { Object } user - The updated user object
updateUser (user) {
    return new Promise((resolve, reject) => {
      fetch(`api/user/${user.id}`, {
        method: 'POST',
        headers: setReqHeaders({ 'Content-Type': 'application/json' }),
        body: JSON.stringify(user)
      }).then((response) => {
        return response.json();
      }).then((response) => {
        if (!response.success) {
          return reject(response);
        }
        return resolve(response);
      }).catch((error) => {
        reject(error);
      });
    });
  }
updateUser ( user ) { return new Promise ( ( resolve , reject ) => { fetch ( ` ${ user . id } ` , { method : 'POST' , headers : setReqHeaders ( { 'Content-Type' : 'application/json' } ) , body : JSON . stringify ( user ) } ) . then ( ( response ) => { return response . json ( ) ; } ) . then ( ( response ) => { if ( ! response . success ) { return reject ( response ) ; } return resolve ( response ) ; } ) . catch ( ( error ) => { reject ( error ) ; } ) ; } ) ; }
Updates a user
 @param {Object} user - The updated user object
Updates a user @param { Object } user - The updated user object