Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //!Complejidad 7... Hay que bajarla a 5
- app.put("/stock/:id", (req, res) =>
- {
- let id = req.params.id
- let datos = req.body
- Articulo.findById(id).exec().then(
- //Complejidad 37
- (articulo) =>
- {
- return modificarStock(articulo, datos)
- }).then(
- //Complejidad 11
- (articuloGuardado) =>
- {
- return RESP._200(res, null , [
- { tipo: articulo, datos: articuloGuardado },
- ]);
- } )
- .catch(
- // Complejidad 10
- err =>{
- return RESP._500(res, {
- msj: 'Hubo un error actualizando el stock.',
- err: err,
- });
- });
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement