diff options
| author | jmreddy2106 <[email protected]> | 2022-05-03 18:29:31 -0400 |
|---|---|---|
| committer | jmreddy2106 <[email protected]> | 2022-05-03 18:29:31 -0400 |
| commit | b861c79f03429313d05ff0a8105b7715aec0ef4d (patch) | |
| tree | b0dcfa8cbf2cc5ce3fda7af854c1ce84ff053cf2 /interface/controllers/mandal.controller.js | |
| parent | f807467dca2f08060b0bd4aa6b30ed231bb383b7 (diff) | |
| download | Welfare-Schemes-DMQL-b861c79f03429313d05ff0a8105b7715aec0ef4d.tar.xz Welfare-Schemes-DMQL-b861c79f03429313d05ff0a8105b7715aec0ef4d.zip | |
added geography controls
Diffstat (limited to 'interface/controllers/mandal.controller.js')
| -rw-r--r-- | interface/controllers/mandal.controller.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/interface/controllers/mandal.controller.js b/interface/controllers/mandal.controller.js new file mode 100644 index 0000000..43842fe --- /dev/null +++ b/interface/controllers/mandal.controller.js @@ -0,0 +1,16 @@ +const db = require("../models"); +const mandal = db.mandal_master; + + +exports.allMandals = () => { + return mandal.findAll({ + attributes: ['mandal_id', 'mandal_name'] + }) +}; + + +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 }); + +}; |
