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/citizens.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/citizens.controller.js')
| -rw-r--r-- | interface/controllers/citizens.controller.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/interface/controllers/citizens.controller.js b/interface/controllers/citizens.controller.js index ee9355b..0ee1d42 100644 --- a/interface/controllers/citizens.controller.js +++ b/interface/controllers/citizens.controller.js @@ -15,6 +15,15 @@ exports.findXCitizens = () => { return sequelize.query(query, { type: QueryTypes.SELECT }) }; + +exports.deleteCitizenbyId = (citizen_id) =>{ + + return citizens.destroy({ + where: { citizen_id } + }) + +}; + exports.editCitizen = (citizen_id, address, mobile_num, dob, marital_status) => { return citizens.update({ address, mobile_num, dob, marital_status @@ -25,6 +34,23 @@ exports.editCitizen = (citizen_id, address, mobile_num, dob, marital_status) => }); }; +//Check Citizen exists or not +exports.checkCitizenId = (citizen_id) => { + return citizens.findOne({ + where: { + citizen_id + } + }).then( + citizen_id => { + if (citizen_id) { + return true; + } + return false; + } + ) +} + + // Get total number of male and female citizens exports.findGenderDistribution = () => { // group by the 'gender' column |
