feat: send robot schedule

This commit is contained in:
karishmas6
2024-10-22 23:17:39 +05:30
parent 3a6f448559
commit 44e483b18b

View File

@@ -392,7 +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.params; const { id } = req.body;
const robot = await Robot.findOne({ where: { 'recording_meta.id': id } }); const robot = await Robot.findOne({ where: { 'recording_meta.id': id } });
if (!robot) { if (!robot) {
@@ -400,7 +400,7 @@ router.get('/schedule/:id', requireSignIn, async (req, res) => {
} }
return res.status(200).json({ return res.status(200).json({
schedule: robot.schedule || { enabled: false } schedule: robot.schedule
}); });
} catch (error) { } catch (error) {