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