fix: E-mandate validation api

This commit is contained in:
2025-12-04 15:09:05 +05:30
parent bf06706b29
commit 1e831acfe2
2 changed files with 4 additions and 4 deletions

View File

@@ -6,7 +6,7 @@ const router = express.Router();
const atmRoute = async (req, res) => { const atmRoute = async (req, res) => {
try { try {
const query_str = 'SELECT * FROM atm'; const query_str = 'SELECT * FROM atm_details';
const result = await db.query(query_str); const result = await db.query(query_str);
return res.json(result.rows); return res.json(result.rows);
} catch (error) { } catch (error) {

View File

@@ -13,12 +13,12 @@ const emandateData = async (req, res) => {
headers: { 'Content-Type': 'application/json', }, headers: { 'Content-Type': 'application/json', },
} }
); );
logger.info("Data validate"); logger.info(response.data, "Data validate");
return response.data; return res.json({data: response.data});
} catch (error) { } catch (error) {
logger.error(error, 'error occured while E-Mandate validation'); logger.error(error, 'error occured while E-Mandate validation');
return res.status(500).json({ error: 'INTERNAL_SERVER_ERROR' }); return res.status(500).json({ error: 'INTERNAL_SERVER_ERROR' });
} }
}; };
router.post('/validation', emandateData); router.post('/validation', emandateData);
module.exports = router; module.exports = router;