icoDashboardCreator/routes.js
// route middleware to check package 2
route middleware to check package 2
route middleware to check package 2
function hasPackage3(req, res, next) {
  ProjectConfiguration.find({
    where: {
      'client_id': req.user.uniqueId,
      'coinName': req.params.projectName
    },
    attributes: {
      exclude: ['coinName', 'ETHRate', 'tokenContractCode','tokenABICode','crowdsaleABICode', 'tokenByteCode', 'tokenContractHash', 'crowdsaleContractCode', 'crowdsaleByteCode', 'crowdsaleContractHash']
    }
  }).then(result => {
    console.log(result.dataValues.isAllowedForICO,"result.dataValues.isAllowedForICO")
    if (result.dataValues.isAllowedForICO == true) {
      console.log("here")
      return next();
    } else {
      req.flash('package_flash', 'You need to buy this package ');
      res.redirect('/dashboard');
    }
  })
}
function hasPackage3 ( req , res , next ) { ProjectConfiguration . find ( { where : { 'client_id' : req . user . uniqueId , 'coinName' : req . params . projectName } , attributes : { exclude : [ 'coinName' , 'ETHRate' , 'tokenContractCode' , 'tokenABICode' , 'crowdsaleABICode' , 'tokenByteCode' , 'tokenContractHash' , 'crowdsaleContractCode' , 'crowdsaleByteCode' , 'crowdsaleContractHash' ] } } ) . then ( result => { console . log ( result . dataValues . isAllowedForICO , "result.dataValues.isAllowedForICO" ) if ( result . dataValues . isAllowedForICO == true ) { console . log ( "here" ) return next ( ) ; } else { req . flash ( 'package_flash' , 'You need to buy this package ' ) ; res . redirect ( '/dashboard' ) ; } } ) }
route middleware to check package 2
route middleware to check package 2