diff --git a/client/src/containers/Items/ItemFormPrimarySection.js b/client/src/containers/Items/ItemFormPrimarySection.js index 5ed70a709..dd90e3c7d 100644 --- a/client/src/containers/Items/ItemFormPrimarySection.js +++ b/client/src/containers/Items/ItemFormPrimarySection.js @@ -139,7 +139,7 @@ function ItemFormPrimarySection({ categoriesList={categoriesList} selecetedCategoryId={values.category_id} onCategorySelected={(category) => { - setFieldValue('item_category_id', category.id); + setFieldValue('category_id', category.id); }} popoverProps={{ minimal: true }} /> diff --git a/server/src/api/controllers/ItemCategories.ts b/server/src/api/controllers/ItemCategories.ts index 8eb5d28e8..3b8a63e40 100644 --- a/server/src/api/controllers/ItemCategories.ts +++ b/server/src/api/controllers/ItemCategories.ts @@ -80,7 +80,7 @@ export default class ItemsCategoriesController extends BaseController { return [ check('name').exists().trim().escape(), check('parent_category_id') - .optional({ nullable: true, checkFalsy: true }) + .optional({ nullable: true }) .isNumeric() .toInt(), check('description') @@ -88,15 +88,15 @@ export default class ItemsCategoriesController extends BaseController { .trim() .escape(), check('sell_account_id') - .optional({ nullable: true, checkFalsy: true }) + .optional({ nullable: true }) .isNumeric() .toInt(), check('cost_account_id') - .optional() + .optional({ nullable: true }) .isNumeric() .toInt(), check('inventory_account_id') - .optional() + .optional({ nullable: true }) .isNumeric() .toInt(), ]