daily pastebin goal
83%
SHARE
TWEET

Untitled

a guest May 16th, 2018 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function shareCard(req,res){
  2.  
  3. var SharedCard = new Promise((resolve,reject) => {
  4.     console.log(1);
  5.     resolve(2)
  6. })
  7. .then(element => {
  8.     console.log(element)
  9.     return(3)
  10. })
  11. .then(element => {
  12.     console.log(element)
  13.     return "Salida"
  14. })
  15. .catch((e)=>{
  16.     res.status(500).send({ err: e});
  17.  });
  18.  
  19. res.status(200).send({Hola : "Hola"})
  20. }
  21.    
  22. function shareCard(req,res){
  23. let idUserSender = req.user._id;
  24.  
  25. var SharedCard = new Promise((resolve,reject) => {
  26.     console.log(1);
  27.     resolve(2)
  28. })
  29. .then(element => {
  30.     User.findById(idUserSender,(err,userFound) => {
  31.         if (err) {
  32.             reject(err)
  33.         } else {
  34.             console.log(element)
  35.             return(3)
  36.         }
  37.     })
  38. })
  39. .then(element => {
  40.     console.log(element)
  41.     return "Salida"
  42. })
  43. .catch((e)=>{
  44.     res.status(500).send({ err: e});
  45.  });
  46.  
  47. res.status(200).send({Hola : "Hola"})
  48. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top