diff --git a/src/app/settings/page.tsx b/src/app/settings/page.tsx index 9b34496..4c3b163 100644 --- a/src/app/settings/page.tsx +++ b/src/app/settings/page.tsx @@ -44,7 +44,7 @@ export default async function SettingsPage() { diff --git a/src/components/ProfileForm.tsx b/src/components/ProfileForm.tsx index c85bc58..ae19499 100644 --- a/src/components/ProfileForm.tsx +++ b/src/components/ProfileForm.tsx @@ -8,12 +8,12 @@ import { updateProfile } from '@/services/profile-actions'; interface ProfileFormProps { initialData: { email?: string; - display_name?: string | null; + username?: string | null; }; } export default function ProfileForm({ initialData }: ProfileFormProps) { - const [displayName, setDisplayName] = useState(initialData.display_name || ''); + const [username, setUsername] = useState(initialData.username || ''); const [isPending, startTransition] = useTransition(); const [status, setStatus] = useState<'idle' | 'success' | 'error'>('idle'); const [error, setError] = useState(null); @@ -24,7 +24,7 @@ export default function ProfileForm({ initialData }: ProfileFormProps) { setError(null); const formData = new FormData(); - formData.set('display_name', displayName); + formData.set('username', username); startTransition(async () => { const result = await updateProfile(formData); @@ -66,16 +66,16 @@ export default function ProfileForm({ initialData }: ProfileFormProps) {

E-Mail kann nicht geƤndert werden

- {/* Display Name */} + {/* Username */}
setDisplayName(e.target.value)} - placeholder="Dein Name" + value={username} + onChange={(e) => setUsername(e.target.value)} + placeholder="Dein Benutzername" className="w-full px-4 py-3 bg-zinc-800 border border-zinc-700 rounded-xl text-white placeholder-zinc-500 focus:outline-none focus:ring-2 focus:ring-orange-500 focus:border-transparent" />
diff --git a/src/services/profile-actions.ts b/src/services/profile-actions.ts index 800c9ee..f88800e 100644 --- a/src/services/profile-actions.ts +++ b/src/services/profile-actions.ts @@ -20,13 +20,13 @@ export async function updateProfile(formData: FormData): Promise