change category ids to category id

This commit is contained in:
hamid zarghami
2025-11-26 10:49:39 +03:30
parent 162d841d90
commit bf2367ace8
4 changed files with 63 additions and 22 deletions
@@ -27,13 +27,13 @@ const BasicInfoSection: FC<BasicInfoSectionProps> = ({ formik, categories }) =>
items={categories}
label='دسته بندی'
placeholder='انتخاب کنید'
name='categoryIds'
value={formik.values.categoryIds[0] || ''}
name='categoryId'
value={formik.values.categoryId}
onChange={(e) => {
const value = e.target.value
formik.setFieldValue('categoryIds', value ? [value] : [])
formik.setFieldValue('categoryId', value)
}}
error_text={formik.touched.categoryIds && formik.errors.categoryIds ? String(formik.errors.categoryIds) : ''}
error_text={formik.touched.categoryId && formik.errors.categoryId ? String(formik.errors.categoryId) : ''}
/>
</div>