mejoras tablas y enpoint update compras

This commit is contained in:
2021-05-02 23:47:33 -05:00
parent 3e9e50e2c3
commit a05bc18d5a
10 changed files with 235 additions and 48 deletions

View File

@@ -41,6 +41,22 @@ router.get("/compras", checkAuth, async (req, res) => {
});
router.put("/compra", checkAuth, async (req, res) => {
const { _id, fecha, detalle, valor, metodopago, categoria } = req.body;
const compra_edit = await Compra.findOne({ _id: _id });
await compra_edit.updateOne({ fecha, detalle, valor, metodopago, categoria });
res.json({
status:"OK"
})
});
router.delete("/compra", checkAuth, async (req, res) => {
try{