diff options
author | eug-vs <eug-vs@keemail.me> | 2021-04-25 00:19:38 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2021-04-25 00:19:38 +0300 |
commit | d781d391241746be086db7dbef6d5361c735de6c (patch) | |
tree | 56dc260882e7c298d557207335e299764b9be5b1 | |
parent | 5c18f9b95e84d42d593d2445edf7f6ddb2a31192 (diff) | |
download | commercel-ui-d781d391241746be086db7dbef6d5361c735de6c.tar.gz |
fix: add missing accountId field
-rw-r--r-- | src/services/transfers/TransferForm.tsx | 1 | ||||
-rw-r--r-- | src/services/types.ts | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/src/services/transfers/TransferForm.tsx b/src/services/transfers/TransferForm.tsx index a10630a..6092aa8 100644 --- a/src/services/transfers/TransferForm.tsx +++ b/src/services/transfers/TransferForm.tsx @@ -16,6 +16,7 @@ const TransferForm: React.FC<FormikProps<Transfer>> = ({ setFieldValue, values } if (!values.date) setFieldValue('date', moment().format('YYYY-MM-DD')); if (!values.contractorId && contractors?.length) setFieldValue('contractorId', contractors[0]._id); + if (!values.accountId && accounts?.length) setFieldValue('accountId', accounts[0]._id); return ( <Form id="form"> diff --git a/src/services/types.ts b/src/services/types.ts index 228bc4d..5c0ba55 100644 --- a/src/services/types.ts +++ b/src/services/types.ts @@ -28,6 +28,7 @@ export interface Transfer extends BaseModel { date: string; operation: 'in' | 'out'; contractorId: string; + accountId: string; amount: number; contractor?: Contractor; } |