diff options
Diffstat (limited to 'interface/controllers/village.controller.js')
| -rw-r--r-- | interface/controllers/village.controller.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/interface/controllers/village.controller.js b/interface/controllers/village.controller.js index 0a488d4..95372fa 100644 --- a/interface/controllers/village.controller.js +++ b/interface/controllers/village.controller.js @@ -11,8 +11,10 @@ exports.allVillages = () => { exports.allVillagesByMandalId = (mandal_id) => { const query =`SELECT * FROM village_master WHERE mandal_id = ${mandal_id}`; - return db.sequelize.query(query, { type: db.sequelize.QueryTypes.SELECT }); - + return db.sequelize.query(query, { type: db.sequelize.QueryTypes.SELECT }).then(villages => { + if (villages) { + return villages; + } + return null; + }); }; - - |
