aboutsummaryrefslogtreecommitdiff
path: root/interface/routes/api/citizens.js
diff options
context:
space:
mode:
authorjmreddy2106 <[email protected]>2022-05-03 20:14:35 -0400
committerjmreddy2106 <[email protected]>2022-05-03 20:14:35 -0400
commit038298fc140f8f1e0bcba02bb422ab0309a73911 (patch)
tree7d580e45895562f89f75f58103bdfeefd323907d /interface/routes/api/citizens.js
parentb861c79f03429313d05ff0a8105b7715aec0ef4d (diff)
downloadWelfare-Schemes-DMQL-038298fc140f8f1e0bcba02bb422ab0309a73911.tar.xz
Welfare-Schemes-DMQL-038298fc140f8f1e0bcba02bb422ab0309a73911.zip
added add user form
Diffstat (limited to 'interface/routes/api/citizens.js')
-rw-r--r--interface/routes/api/citizens.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/interface/routes/api/citizens.js b/interface/routes/api/citizens.js
index 6dad084..40e0c16 100644
--- a/interface/routes/api/citizens.js
+++ b/interface/routes/api/citizens.js
@@ -52,4 +52,29 @@ router.post('/validate', (req, res) => {
});
+router.post('/addnewcitizen', (req, res) => {
+ const { citizen_id, first_name, last_name, address, mobile_num, dob, gender, marital_status, disabled, disbaled_percentage, caste, village_id} = req.body;
+
+ if(!citizen_id && !first_name && !last_name && !address && !mobile_num && !dob && !gender && !marital_status && !disabled && !caste && !village_id){
+
+ res.status(400).json({ message: "Please fill in all fields" });
+
+ }else{
+ citizensController.addNewCitizen(citizen_id, first_name, last_name, address, mobile_num, dob, gender, marital_status, disabled, disbaled_percentage, caste, village_id).then(() => {
+ res.status(200).json({ message: "Citizen added successfully" });
+ }).catch((err) => {
+ res.status(400).json({ message: err });
+ });
+ }
+
+});
+
+
+
+
+
+
+
+
+
module.exports = router; \ No newline at end of file