Skip to content

Commit

Permalink
Merge pull request #45 from ShubhaMahobia/shubham_dev
Browse files Browse the repository at this point in the history
Refactor authenticationController.js and UserDoctorModel.js to add us…
  • Loading branch information
ShubhaMahobia authored May 8, 2024
2 parents e763ae3 + f0edd55 commit b98fcfb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions controller/authenticationController.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ exports.signUpPatient = async (req, res) => {
identificationNumber: hashedIdentificationNumber,
latitude: req.body.latitude,
longitude: req.body.longitude,
userType: "patient",
});
const userExist = await userPatient.findOne({
identificationNumber: req.body.identificationNumber,
Expand Down Expand Up @@ -102,6 +103,7 @@ exports.signUpDoctor = async (req, res) => {
breifDescription: req.body.breifDescription,
latitude: req.body.latitude,
longitude: req.body.longitude,
userType: "doctor",
});
//Checking is user already exist in database or not
const userExist = await userDoctor.findOne({
Expand Down
4 changes: 4 additions & 0 deletions model/UserDoctorModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ const DoctorUserSchema = new mongoose.Schema({
type: String,
required: true,
},
userType: {
type: String,
required: true,
},
//Adding these field to save exact address of the user by their location and we can update if we want in future.
longitude: {
type: String,
Expand Down
4 changes: 4 additions & 0 deletions model/UserPatientModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ const PatientUserSchema = new mongoose.Schema({
type: String,
required: true,
},
userType: {
type: String,
required: true,
},
//Adding these field to save exact address of the user by their location and we can update if we want in future.
longitude: {
type: String,
Expand Down

0 comments on commit b98fcfb

Please sign in to comment.