Skip to content

Commit

Permalink
Merge pull request #47 from ShubhaMahobia/shubham_dev
Browse files Browse the repository at this point in the history
chore: Add userTypeDefine API to authenticationController.js
  • Loading branch information
ShubhaMahobia authored May 9, 2024
2 parents 178b7bd + 7bc029e commit dc7d2c7
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions controller/authenticationController.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,25 @@ exports.isPatientExist = async (req, res) => {
}
};


//Api to check if the user is doctor or patient based on the firebaseUserId
exports.userTypeDefine = async (req, res) => {
try {
const isUserExist = await userPatient.findOne({
firebaseUserId: req.body.firebaseUserId,
});
if (isUserExist) {
return res.status(400).json({ success: true, isPatient: true });
} else {
return res.status(200).json({ success: true, isPatient: false });
}
} catch (error) {
return res
.status(400)
.json({ success: false, message: "Internal Server Error" });
}
};

//This is the create Profile Function for the user(Patient)
exports.signUpPatient = async (req, res) => {
try {
Expand Down

0 comments on commit dc7d2c7

Please sign in to comment.