Skip to content

Commit

Permalink
Merge branch 'develop' into Despliegue
Browse files Browse the repository at this point in the history
  • Loading branch information
UO271728 committed May 1, 2022
2 parents 5212ff3 + eb1b10e commit 9266a79
Show file tree
Hide file tree
Showing 15 changed files with 855 additions and 309 deletions.
187 changes: 146 additions & 41 deletions restapi/package-lock.json

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions restapi/routes/juguete.router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,5 +157,26 @@ jugueteRouter.post("/addStock/:nombre", async (req:Request,res:Response) => {
res.status(500).send("Error al añadir stock al juguete")
}
});
/*
jugueteRouter.post("/subtock/:nombre", async (req:Request,res:Response) => {
try{
const filter = {
nombre: req.params.nombre,
}
var juguete = await JugueteRepository.findJuguete(filter);
const stock = {stock: juguete.stock - req.body.stock}
var jugueteActualizado = await JugueteRepository.updateJuguete(filter,stock);
if(jugueteActualizado){
res.send("Stock del juguete restado correctamente");
} else{
res.status(500).send("No se pudo restar stock al producto")
}
}catch (error){
res.status(500).send("Error al restar stock al juguete")
}
});
*/
export default jugueteRouter;
Loading

0 comments on commit 9266a79

Please sign in to comment.