aboutsummaryrefslogtreecommitdiff
path: root/interface/controllers/district.controller.js
diff options
context:
space:
mode:
authorBobby <[email protected]>2022-05-03 22:04:51 -0400
committerGitHub <[email protected]>2022-05-03 22:04:51 -0400
commit97ecf128297c65939dd196bbf731d7713ff3eb17 (patch)
tree2e34ce476542d17871791d19fb45fd6a20d61bfa /interface/controllers/district.controller.js
parent038298fc140f8f1e0bcba02bb422ab0309a73911 (diff)
parentf1b9662122abed09ccf74b2eda034e7a45730e60 (diff)
downloadWelfare-Schemes-DMQL-97ecf128297c65939dd196bbf731d7713ff3eb17.tar.xz
Welfare-Schemes-DMQL-97ecf128297c65939dd196bbf731d7713ff3eb17.zip
Merge pull request #6 from luciferreeves/main
wowowow
Diffstat (limited to 'interface/controllers/district.controller.js')
-rw-r--r--interface/controllers/district.controller.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/interface/controllers/district.controller.js b/interface/controllers/district.controller.js
index 5b21530..468d5fb 100644
--- a/interface/controllers/district.controller.js
+++ b/interface/controllers/district.controller.js
@@ -10,10 +10,10 @@ exports.allDistricts = () => {
exports.allDistrictsByStateId = (state_id) => {
const query =`SELECT * FROM district_master WHERE state_id = ${state_id}`;
- return db.sequelize.query(query, { type: db.sequelize.QueryTypes.SELECT });
+ return db.sequelize.query(query, { type: db.sequelize.QueryTypes.SELECT }).then(districts => {
+ if (districts) {
+ return districts;
+ }
+ return null;
+ });
};
-
-
-
-
-