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