diff options
| author | Bobby <[email protected]> | 2022-05-03 22:04:51 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-05-03 22:04:51 -0400 |
| commit | 97ecf128297c65939dd196bbf731d7713ff3eb17 (patch) | |
| tree | 2e34ce476542d17871791d19fb45fd6a20d61bfa /interface/controllers/mandal.controller.js | |
| parent | 038298fc140f8f1e0bcba02bb422ab0309a73911 (diff) | |
| parent | f1b9662122abed09ccf74b2eda034e7a45730e60 (diff) | |
| download | Welfare-Schemes-DMQL-97ecf128297c65939dd196bbf731d7713ff3eb17.tar.xz Welfare-Schemes-DMQL-97ecf128297c65939dd196bbf731d7713ff3eb17.zip | |
Merge pull request #6 from luciferreeves/main
wowowow
Diffstat (limited to 'interface/controllers/mandal.controller.js')
| -rw-r--r-- | interface/controllers/mandal.controller.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/interface/controllers/mandal.controller.js b/interface/controllers/mandal.controller.js index 43842fe..5e4d287 100644 --- a/interface/controllers/mandal.controller.js +++ b/interface/controllers/mandal.controller.js @@ -11,6 +11,10 @@ exports.allMandals = () => { exports.allMandalsByDistrictId = (district_id) => { const query =`SELECT * FROM mandal_master WHERE district_id = ${district_id}`; - return db.sequelize.query(query, { type: db.sequelize.QueryTypes.SELECT }); - + return db.sequelize.query(query, { type: db.sequelize.QueryTypes.SELECT }).then(mandals => { + if (mandals) { + return mandals; + } + return null; + }); }; |
