mejoras tablas y enpoint update compras
This commit is contained in:
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user