From 40fb5a6c1574150d472f006e21164ec1d301ff8b Mon Sep 17 00:00:00 2001 From: hamid zarghami Date: Sat, 25 Oct 2025 16:22:24 +0330 Subject: [PATCH] change create product --- src/pages/products/components/Step2Form.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/pages/products/components/Step2Form.tsx b/src/pages/products/components/Step2Form.tsx index 6794448..603b1e8 100644 --- a/src/pages/products/components/Step2Form.tsx +++ b/src/pages/products/components/Step2Form.tsx @@ -9,8 +9,8 @@ import { CloseCircle } from 'iconsax-react'; interface AttributeSelectorProps { attribute: CategoryAttributeType; - selectedValues: number[]; - onChange: (attributeId: number, values: number[]) => void; + selectedValues: string[]; + onChange: (attributeId: number, values: string[]) => void; } interface TextNumberInputProps { @@ -20,7 +20,7 @@ interface TextNumberInputProps { } const AttributeSelector: FC = ({ attribute, selectedValues, onChange }) => { - const handleValueChange = (valueId: number, checked: boolean) => { + const handleValueChange = (valueId: string, checked: boolean) => { if (attribute.multiple) { // چند انتخابی - checkbox const newValues = checked @@ -46,7 +46,7 @@ const AttributeSelector: FC = ({ attribute, selectedValu
{attribute.values.map((value) => { - const isChecked = selectedValues.includes(value._id); + const isChecked = selectedValues.includes(value.text); return (