diff --git a/frontend/src/components/settings/SettingsPage.tsx b/frontend/src/components/settings/SettingsPage.tsx index e76e550..a6fd474 100644 --- a/frontend/src/components/settings/SettingsPage.tsx +++ b/frontend/src/components/settings/SettingsPage.tsx @@ -437,9 +437,15 @@ export default function SettingsPage() { variant="input" id="date_of_birth" value={dateOfBirth} - onChange={(v) => setDateOfBirth(v)} - onBlur={() => handleProfileSave('date_of_birth')} - onKeyDown={(e) => { if (e.key === 'Enter') handleProfileSave('date_of_birth'); }} + onChange={(v) => { + setDateOfBirth(v); + const orig = profileQuery.data?.date_of_birth ?? ''; + if (v.trim() !== (orig || '')) { + api.put('/auth/profile', { date_of_birth: v.trim() || null }) + .then(() => { queryClient.invalidateQueries({ queryKey: ['profile'] }); toast.success('Profile updated'); }) + .catch(() => toast.error('Failed to update profile')); + } + }} />