Advertisement
Guest User

Untitled

a guest
Nov 19th, 2013
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. forEach(request.body.contact,function(row,index){
  2.            
  3.                if(request.body.contact[index].tempid)
  4.                 {
  5.                     var o=request.body.contact[index];
  6.                     pair=Object.keys(o).map(function(a){ return [a, o[a]] });
  7.                     AM.addcontact(pair,request.session.user,request.body.contact.length,function(e,o){
  8.                         if(!o)
  9.                         {
  10.                              response.send('something went wrong'+e);
  11.            
  12.                         }
  13.                         else
  14.                         {  //response.send(o);
  15.                            ardata+=o;
  16.                         }
  17.        
  18.                     });
  19.                    
  20.                    
  21.                 }
  22.                 else
  23.                 {
  24.                   response.send('please provide atleast cid or tempid for insertion or updation of contacts');
  25.                 }
  26. response.send(ardata);
  27.                
  28.            });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement