function checkUpdatedUser(apiKey, email) {
    return new Promise((resolve, reject) => {
      logger.debug(email + " - Check the lists of the user");

      if (!apiKey || !email)
        return reject(new Error("No Parameters Provided"));

      ListUser.find({
        email: email,
        sync: true
      }, function (err, lists) {
        if (err) return reject(err.stack);

        if (lists.length == 0) return resolve(null);

        lists.forEach(function (list, index) {
          checkUpdatedList(apiKey, list.listId).then(returnObject => {
            logger.debug(list.listId + " - List checked");
            if (index == lists.length - 1)
              return resolve(null);
          }).catch(err => {
            return reject(err.stack);
          });
        });
      });
    });
  }
//Comprueba todas las listas del usuario.
Comprueba todas las listas del usuario.
Comprueba todas las listas del usuario .
function checkUpdatedUser(apiKey, email) {
    return new Promise((resolve, reject) => {
      logger.debug(email + " - Check the lists of the user");
      if (!apiKey || !email)
        return reject(new Error("No Parameters Provided"));
      ListUser.find({
        email: email,
        sync: true
      }, function (err, lists) {
        if (err) return reject(err.stack);
        if (lists.length == 0) return resolve(null);
        lists.forEach(function (list, index) {
          checkUpdatedList(apiKey, list.listId).then(returnObject => {
            logger.debug(list.listId + " - List checked");
            if (index == lists.length - 1)
              return resolve(null);
          }).catch(err => {
            return reject(err.stack);
          });
        });
      });
    });
  }
function checkUpdatedUser ( apiKey , email ) { return new Promise ( ( resolve , reject ) => { logger . debug ( email + " - Check the lists of the user" ) ; if ( ! apiKey || ! email ) return reject ( new Error ( "No Parameters Provided" ) ) ; ListUser . find ( { email : email , sync : true } , function ( err , lists ) { if ( err ) return reject ( err . stack ) ; if ( lists . length == 0 ) return resolve ( null ) ; lists . forEach ( function ( list , index ) { checkUpdatedList ( apiKey , list . listId ) . then ( returnObject => { logger . debug ( list . listId + " - List checked" ) ; if ( index == lists . length - 1 ) return resolve ( null ) ; } ) . catch ( err => { return reject ( err . stack ) ; } ) ; } ) ; } ) ; } ) ; }
Comprueba todas las listas del usuario.
Comprueba todas las listas del usuario .