Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.post(
- '/api/xero/get/taxrates',
- auth.user(),
- function(req, res){
- console.log('get taxrates has been triggered...');
- async.series([
- function(next){
- xero.getBillTaxRates({
- prefix: config.redis.prefix,
- user_id: req.user.id,
- api_id: 'xero'
- },function(err, data){
- if(data[0].Status !=='OK'){
- var failed_data = {
- result:'failed',
- message:'Someting went wrong fetching taxrates from api',
- error: err
- };
- next(true,failed_data);
- }else{
- next(null,data[0].TaxRates);
- }
- });
- }
- ],function(err, result){
- console.log('finish... making a response now...');
- console.log(result[0]);
- response.json(res, result[0]);
- });
- }
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement