Fix: Remove encType from product edit form with Server Action
The form was specifying both a Server Action AND encType='multipart/form-data', which caused a React warning and slow submissions (26+ seconds). Next.js automatically handles encoding for Server Actions, so encType should not be specified. Submission now completes in ~3 seconds. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Haiku 4.5
parent
9c7999b8d7
commit
7fa324bc07
@@ -29,7 +29,7 @@ export default async function EditProductPage({ params }: { params: { id: string
|
|||||||
Changes apply immediately to the live product at /made-to-order/{product.slug}.
|
Changes apply immediately to the live product at /made-to-order/{product.slug}.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<form action={updateProduct} className="mt-10 space-y-6" encType="multipart/form-data">
|
<form action={updateProduct} className="mt-10 space-y-6">
|
||||||
<input type="hidden" name="id" value={product.id} />
|
<input type="hidden" name="id" value={product.id} />
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
Reference in New Issue
Block a user