Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. //!Complejidad 7... Hay que bajarla a 5
  2. app.put("/stock/:id", (req, res) =>
  3. {
  4. let id = req.params.id
  5. let datos = req.body
  6. Articulo.findById(id).exec().then(
  7. //Complejidad 37
  8. (articulo) =>
  9. {
  10.  
  11. return modificarStock(articulo, datos)
  12.  
  13. }).then(
  14. //Complejidad 11
  15. (articuloGuardado) =>
  16. {
  17. return RESP._200(res, null , [
  18. { tipo: articulo, datos: articuloGuardado },
  19. ]);
  20.  
  21. } )
  22. .catch(
  23. // Complejidad 10
  24. err =>{
  25. return RESP._500(res, {
  26. msj: 'Hubo un error actualizando el stock.',
  27. err: err,
  28. });
  29. });
  30. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement