fix: get id from req.params
This commit is contained in:
@@ -392,8 +392,7 @@ router.put('/schedule/:id/', requireSignIn, async (req, res) => {
|
|||||||
// Endpoint to get schedule details
|
// Endpoint to get schedule details
|
||||||
router.get('/schedule/:id', requireSignIn, async (req, res) => {
|
router.get('/schedule/:id', requireSignIn, async (req, res) => {
|
||||||
try {
|
try {
|
||||||
const { id } = req.body;
|
const robot = await Robot.findOne({ where: { 'recording_meta.id': req.params.id }, raw: true });
|
||||||
const robot = await Robot.findOne({ where: { 'recording_meta.id': id } });
|
|
||||||
|
|
||||||
if (!robot) {
|
if (!robot) {
|
||||||
return res.status(404).json({ error: 'Robot not found' });
|
return res.status(404).json({ error: 'Robot not found' });
|
||||||
|
|||||||
Reference in New Issue
Block a user