fix: fields not saving values in item category dialog

This commit is contained in:
elforjani3
2020-11-14 18:11:53 +02:00
parent b3dbc0d3b9
commit 173f13fc60

View File

@@ -24,7 +24,7 @@ export default function ItemCategoryForm({
accountsList,
categoriesList,
isSubmitting,
onClose
onClose,
}) {
// Filters Item Categories list.
const filterItemCategories = useCallback(
@@ -74,7 +74,7 @@ export default function ItemCategoryForm({
</FastField>
{/* ----------- Parent Category ----------- */}
<FastField name={'parent_account_id'}>
<FastField name={'parent_category_id'}>
{({ form, field: { value }, meta: { error, touched } }) => (
<FormGroup
label={<T id={'parent_category'} />}
@@ -107,7 +107,7 @@ export default function ItemCategoryForm({
</FastField>
{/* ----------- Description ----------- */}
<FastField name={'description`'}>
<FastField name={'description'}>
{({ field, field: { value }, meta: { error, touched } }) => (
<FormGroup
label={<T id={'description'} />}
@@ -138,7 +138,7 @@ export default function ItemCategoryForm({
<AccountsSelectList
accounts={accountsList}
onAccountSelected={(account) => {
form.setFieldValue(account.id);
form.setFieldValue('cost_account_id', account.id);
}}
defaultSelectText={<T id={'select_account'} />}
selectedAccountId={value}