diff --git a/src/pages/request/components/ManageAttribute.tsx b/src/pages/request/components/ManageAttribute.tsx index 9e46b73..b046154 100644 --- a/src/pages/request/components/ManageAttribute.tsx +++ b/src/pages/request/components/ManageAttribute.tsx @@ -22,11 +22,11 @@ const ManageAttribute: FC = (props) => { const handleChange = (attributeId: string, value: string) => { const attribute = formik.values.attributes - const index: number = attribute.findIndex(o => o.attributeId === attributeId) + const index: number = attribute.findIndex(o => o.fieldId === attributeId) if (index > -1) { attribute[index].value = value } else { - attribute.push({ attributeId: attributeId, value: value }) + attribute.push({ fieldId: attributeId, value: value }) } formik.setFieldValue('attributes', attribute) } @@ -61,7 +61,7 @@ const ManageAttribute: FC = (props) => {
{ item.options?.map((value) => { - const object = formik.values.attributes.find(o => o.attributeId === item.id) + const object = formik.values.attributes.find(o => o.fieldId === item.id) return (
{value.value}
@@ -78,7 +78,7 @@ const ManageAttribute: FC = (props) => {
) else if (item.type === FieldTypeEnum.radio) { - const object = formik.values.attributes.find(o => o.attributeId === item.id) + const object = formik.values.attributes.find(o => o.fieldId === item.id) return (
{item.name}
diff --git a/src/pages/request/type/Types.ts b/src/pages/request/type/Types.ts index 364bd7c..a5ee681 100644 --- a/src/pages/request/type/Types.ts +++ b/src/pages/request/type/Types.ts @@ -21,7 +21,7 @@ export type RequestType = { productId?: string; quantity?: number; attributes: { - attributeId: string; + fieldId: string; value: string | number; }[]; attachments: AttachmentsType[];