diff --git a/components/form/product/create-product-form.tsx b/components/form/product/create-product-form.tsx index 1cf0ee9..d44de33 100644 --- a/components/form/product/create-product-form.tsx +++ b/components/form/product/create-product-form.tsx @@ -74,9 +74,9 @@ export default function AddProductForm() { formData.append("colors", JSON.stringify(colorsPayload)); // 🔥 color images - colors.forEach((c, index) => { + colors.forEach((c) => { if (c.file) { - formData.append(`color_images[${index}]`, c.file); + formData.append("color_images", c.file); } }); @@ -217,7 +217,14 @@ export default function AddProductForm() { - + { + const updated = [...colors]; + updated[index].name = e.target.value; + setColors(updated); + }} + /> {/* Pilihan Warna */}
@@ -239,7 +246,12 @@ export default function AddProductForm() {