fix update

This commit is contained in:
Manuel Romero
2025-02-11 13:00:32 +01:00
parent dcd45d11c8
commit 2ffef5ff21

View File

@@ -32,9 +32,9 @@ const SYNAPSE_QUEUE = MYQUEUES.SYNAPSE_QUEUE;
*/
router.put('/:id', passport.ensureAuthenticatedAndAdmin, async (req, res, next) => {
try {
var body = req.body;
body.owner = req.user._id;
const result = await db.snapshot.update(req.params.id, req.body);
var patch = req.body;
patch.owner = req.user._id;
const result = await db.snapshot.update(req.params.id, patch);
return res.json(result);
} catch (error) {
next(error);