diff --git a/src/components/images/field.tsx b/src/components/images/field.tsx index 7ffad7e..f1da6ba 100644 --- a/src/components/images/field.tsx +++ b/src/components/images/field.tsx @@ -127,7 +127,7 @@ const ImageField: React.FC = ({ label='', value, name, onChang alt="" className="aspect-square w-full h-full object-cover rounded-md" /> -
+
deleteImage(e, imgData.id)}>
@@ -136,7 +136,7 @@ const ImageField: React.FC = ({ label='', value, name, onChang ))} diff --git a/src/components/images/modal.tsx b/src/components/images/modal.tsx index 91067bf..8b04afb 100644 --- a/src/components/images/modal.tsx +++ b/src/components/images/modal.tsx @@ -172,7 +172,7 @@ const ImageChooseModal: React.FC = ({ onClose, onSelected
@@ -113,7 +113,7 @@ function CollectionModal({ isOpen, onClose, onSubmit, edit }: CollectionModalPro id="name" name='description' errorData={errorData} - value={formData.description} + value={formData.description || ''} onChange={handleChange} className="mt-1 block w-full border border-gray-300 rounded-md shadow-sm p-2 focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" /> diff --git a/src/pages/color/colorList.tsx b/src/pages/color/colorList.tsx index e63f514..8a443ae 100644 --- a/src/pages/color/colorList.tsx +++ b/src/pages/color/colorList.tsx @@ -113,7 +113,7 @@ function Color() { - {colors.map((row: any, index) => ( + {colors?.map((row: any, index) => ( ({}); + const [formData, setFormData] = useState({ name: '', code: '#000000' }); const [errorData, setErrorData] = useState({}); const api = useApi(); @@ -80,7 +80,7 @@ function ColorModal({ isOpen, onClose, onSubmit, edit }: ColorModalProps) { id="name" name='name' errorData={errorData} - value={formData.name} + value={formData.name || ''} onChange={handleChange} className="mt-1 block w-full border border-gray-300 rounded-md shadow-sm p-2 focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" /> @@ -93,7 +93,7 @@ function ColorModal({ isOpen, onClose, onSubmit, edit }: ColorModalProps) { diff --git a/src/pages/productType/modal.tsx b/src/pages/productType/modal.tsx index 466f45a..077fafd 100644 --- a/src/pages/productType/modal.tsx +++ b/src/pages/productType/modal.tsx @@ -87,7 +87,7 @@ function ProductTypeModal({ isOpen, onClose, onSubmit, edit }: ProductTypeModalP id="name" name='name' errorData={errorData} - value={formData.name} + value={formData.name || ''} onChange={handleChange} className="mt-1 block w-full border border-gray-300 rounded-md shadow-sm p-2 focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm" /> @@ -100,7 +100,7 @@ function ProductTypeModal({ isOpen, onClose, onSubmit, edit }: ProductTypeModalP Indicates whether this product type is subject to taxation @@ -110,7 +110,7 @@ function ProductTypeModal({ isOpen, onClose, onSubmit, edit }: ProductTypeModalP Select if this product type represents tangible, shippable items @@ -120,7 +120,7 @@ function ProductTypeModal({ isOpen, onClose, onSubmit, edit }: ProductTypeModalP Enable inventory management for this product type @@ -130,7 +130,7 @@ function ProductTypeModal({ isOpen, onClose, onSubmit, edit }: ProductTypeModalP Allow multiple variations of this product type (e.g., sizes, colors)