summaryrefslogtreecommitdiff
path: root/src/services/transfers
diff options
context:
space:
mode:
Diffstat (limited to 'src/services/transfers')
-rw-r--r--src/services/transfers/TransfersUpload.tsx3
-rw-r--r--src/services/transfers/index.ts9
2 files changed, 7 insertions, 5 deletions
diff --git a/src/services/transfers/TransfersUpload.tsx b/src/services/transfers/TransfersUpload.tsx
index 1c81b08..18a33b8 100644
--- a/src/services/transfers/TransfersUpload.tsx
+++ b/src/services/transfers/TransfersUpload.tsx
@@ -3,7 +3,8 @@ import { useHistory } from 'react-router-dom';
import { Form, Formik } from 'formik';
import Button from '../../components/Button';
import Input from '../../components/Input';
-import Page, { Action } from '../../containers/Page';
+import Page from '../../containers/Page';
+import { Action } from '../../containers/Service/ServiceContext';
import { post } from '../../requests';
const TransfersUpload: React.FC = () => {
diff --git a/src/services/transfers/index.ts b/src/services/transfers/index.ts
index 09f6e04..51be7e3 100644
--- a/src/services/transfers/index.ts
+++ b/src/services/transfers/index.ts
@@ -1,16 +1,17 @@
import Form from './TransferForm';
import UploadPage from './TransfersUpload';
+import { transformOperation } from '../transforms';
+import { ServiceParams } from '../../containers/Service/ServiceContext';
-import { operationNames } from '../constants';
-const service = {
+const service: ServiceParams = {
route: 'transfers',
name: 'Переводы',
nameSingular: 'Перевод',
tableFields: [
- { key: 'date', label: 'Дата', transform: (date: string) => new Date(date).toLocaleDateString() },
+ { key: 'date', label: 'Дата', transform: date => new Date(date).toLocaleDateString() },
{ key: 'contractor.name', label: 'Контрагент' },
- { key: 'operation', label: 'Операция', transform: (op: 'in' | 'out') => operationNames[op] },
+ { key: 'operation', label: 'Операция', transform: transformOperation },
{ key: 'amount', label: 'Сумма' },
],
actions: [