vicinityManager/server/services/registrations/register.js
/*
Looking for duplicates in user registration
*/
Looking for duplicates in user registration
Looking for duplicates in user registration
function findDuplicatesUser(data) {
  var email = data.email;
  return new Promise(function(resolve, reject) {
    userOp.find({email: email}, {email:1}, function(err, output) {
      if (err) {
        reject(err);
      } else {
        if(output.length === 0){
          resolve(false); 
        } else {
          resolve(true); 
        }
      }
    });
  });
}
function findDuplicatesUser ( data ) { var email = data . email ; return new Promise ( function ( resolve , reject ) { userOp . find ( { email : email } , { email : 1 } , function ( err , output ) { if ( err ) { reject ( err ) ; } else { if ( output . length === 0 ) { resolve ( false ) ; } else { resolve ( true ) ; } } } ) ; } ) ; }
Looking for duplicates in user registration
Looking for duplicates in user registration
// No duplicates // Duplicates found