diff --git a/src/app/(web)/account/page.jsx b/src/app/(web)/account/page.jsx index 7475de3..d0cb3fb 100644 --- a/src/app/(web)/account/page.jsx +++ b/src/app/(web)/account/page.jsx @@ -59,13 +59,18 @@ const AccountPage = () => { }; const handleSave = async () => { - await axios.put(`/api/patients/${selectedPatient.email}`, { - medications, - medicalConditions: diagnoses, - }); - alert('Patient data updated successfully'); + 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
Loading...
; return (