fix handleSave

This commit is contained in:
Joseph J Helfenbein
2025-01-25 09:19:04 -05:00
parent 2874ef337e
commit 027b895c5f

View File

@@ -59,13 +59,18 @@ const AccountPage = () => {
}; };
const handleSave = async () => { const handleSave = async () => {
await axios.put(`/api/patients/${selectedPatient.email}`, { try {
medications, await axios.put(`/api/patients?email=${selectedPatient.email}`, {
medicalConditions: diagnoses, medications,
}); medicalConditions: diagnoses,
alert('Patient data updated successfully'); });
alert('Patient data updated successfully');
} catch (error) {
console.error('Error updating patient data:', error);
alert('Failed to update patient data');
}
}; };
if (!userData) return <div>Loading...</div>; if (!userData) return <div>Loading...</div>;
return ( return (