From 0ae1fe8d3b42c356f8832f0d22307a156f615338 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Wed, 23 Oct 2024 00:10:48 +0530 Subject: [PATCH] fix: get id from req.params --- server/src/routes/storage.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/src/routes/storage.ts b/server/src/routes/storage.ts index 5e768b6e..f88bd74f 100644 --- a/server/src/routes/storage.ts +++ b/server/src/routes/storage.ts @@ -392,8 +392,7 @@ router.put('/schedule/:id/', requireSignIn, async (req, res) => { // Endpoint to get schedule details router.get('/schedule/:id', requireSignIn, async (req, res) => { try { - const { id } = req.body; - const robot = await Robot.findOne({ where: { 'recording_meta.id': id } }); + const robot = await Robot.findOne({ where: { 'recording_meta.id': req.params.id }, raw: true }); if (!robot) { return res.status(404).json({ error: 'Robot not found' });