feat: get robot by user id

This commit is contained in:
karishmas6
2024-10-21 20:42:00 +05:30
parent 1214aeb824
commit 17ea711c32

View File

@@ -29,7 +29,9 @@ router.all('/', requireSignIn, (req, res, next) => {
*/
router.get('/recordings', requireSignIn, async (req, res) => {
try {
const data = await Robot.findAll();
const data = await Robot.findAll({
where: { userId: req.user.id },
});
return res.send(data);
} catch (e) {
logger.log('info', 'Error while reading recordings');