fix handleSave
This commit is contained in:
@@ -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>;
|
||||
|
||||
Reference in New Issue
Block a user