From 5c18f9b95e84d42d593d2445edf7f6ddb2a31192 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sat, 24 Apr 2021 21:27:06 +0300 Subject: feat: add account field into transfer form --- src/services/accounts/index.ts | 1 + src/services/transfers/TransferForm.tsx | 9 ++++++++- src/services/types.ts | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) (limited to 'src/services') diff --git a/src/services/accounts/index.ts b/src/services/accounts/index.ts index fc3a830..1936a9c 100644 --- a/src/services/accounts/index.ts +++ b/src/services/accounts/index.ts @@ -7,6 +7,7 @@ const service: ServiceParams = { nameSingular: 'Счёт', tableFields: [ { key: 'name', label: 'Название' }, + { key: 'currency', label: 'Валюта' }, { key: 'balance', label: 'Баланс' }, ], searchBy: ['name'], diff --git a/src/services/transfers/TransferForm.tsx b/src/services/transfers/TransferForm.tsx index 92846a3..a10630a 100644 --- a/src/services/transfers/TransferForm.tsx +++ b/src/services/transfers/TransferForm.tsx @@ -12,20 +12,27 @@ const mapper = (item: Contractor) => ({ key: item._id, label: item.name }); const TransferForm: React.FC> = ({ setFieldValue, values }) => { const { data: contractors } = hooks.contractors.useList(); + const { data: accounts } = hooks.accounts.useList(); if (!values.date) setFieldValue('date', moment().format('YYYY-MM-DD')); if (!values.contractorId && contractors?.length) setFieldValue('contractorId', contractors[0]._id); return (
+
+ -