add console logs

This commit is contained in:
Joseph J Helfenbein
2025-01-25 06:55:56 -05:00
parent a05321e8af
commit 67a5e145e0
2 changed files with 16 additions and 1 deletions

View File

@@ -7,9 +7,14 @@ export default async (req, res) => {
const { email } = req.query;
const { medications, medicalConditions } = req.body;
console.log('Received request to update patient with email:', email);
console.log('Medications:', medications);
console.log('Medical Conditions:', medicalConditions);
const patient = await User.findOne({ email });
if (!patient) {
console.log('Patient not found for email:', email);
return res.status(404).json({ message: 'Patient not found' });
}
@@ -17,5 +22,7 @@ export default async (req, res) => {
patient.medicalConditions = medicalConditions;
await patient.save();
console.log('Patient data updated successfully:', patient);
res.json(patient);
};