From ffbbea27d7b247a5f668e634b89f3371dad25688 Mon Sep 17 00:00:00 2001 From: asif Date: Mon, 22 Sep 2025 15:04:04 +0530 Subject: [PATCH] fix: ifsc details 404 on wrong IFSC --- src/controllers/beneficiary.controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/beneficiary.controller.js b/src/controllers/beneficiary.controller.js index c079c64..abaea38 100644 --- a/src/controllers/beneficiary.controller.js +++ b/src/controllers/beneficiary.controller.js @@ -121,7 +121,7 @@ async function getIfscDetails(req, res) { try { const query = 'SELECT * FROM ifsc_details WHERE ifsc_code = $1'; const result = await db.query(query, [ifscCode]); - if (!result.rows) { + if (result.rows?.length === 0) { res.status(404).json({ error: 'NOT_FOUND' }); return; }