fix: ifsc details 404 on wrong IFSC

This commit is contained in:
2025-09-22 15:04:04 +05:30
parent a706fd8c21
commit ffbbea27d7

View File

@@ -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;
}