1
0
Fork 0

fix: remove encType from Server-Action forms to fix upload error

React 19 forbids setting encType/method on a <form> whose action is a
function - it manages FormData (including files) itself. The extra
attribute triggered a console error and blocked "Fahrt beginnen" /
"Schadensfoto nachtragen" whenever photos were attached.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HCHRPWuV3bd37NJhW2NK6P
This commit is contained in:
Jonny 2026-08-18 11:27:33 +02:00
parent 930994126f
commit eb0fad8c16
1 changed files with 2 additions and 2 deletions

View File

@ -89,7 +89,7 @@ export default async function AuftragDetailPage({
{auftrag.status === "zugewiesen" && istEigenerAuftrag && (
<Card className="mb-6">
<form action={fahrtBeginnenAction} encType="multipart/form-data">
<form action={fahrtBeginnenAction}>
<h2 className="mb-4 text-lg font-semibold text-asphalt-grey">Fahrt beginnen</h2>
<FormField label="KM-Stand" htmlFor="start_km">
<input id="start_km" name="start_km" type="number" min="0" required className={FIELD_CLASSES} />
@ -135,7 +135,7 @@ export default async function AuftragDetailPage({
{auftrag.status === "unterwegs" && istEigenerAuftrag && (
<Card className="mb-6">
<form action={schadenFotoNachtragenAction} encType="multipart/form-data">
<form action={schadenFotoNachtragenAction}>
<h2 className="mb-4 text-lg font-semibold text-asphalt-grey">Schadensfoto nachtragen</h2>
<FormField label="Schadensfotos (mehrere möglich)" htmlFor="foto_schaden_nachtrag">
<input