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,11 +59,16 @@ const AccountPage = () => {
};
const handleSave = async () => {
await axios.put(`/api/patients/${selectedPatient.email}`, {
try {
await axios.put(`/api/patients?email=${selectedPatient.email}`, {
medications,
medicalConditions: diagnoses,
});
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>;