From f1cdf02e9c0dca3354f4eebd38edd2ba12075893 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Fri, 26 Mar 2021 00:44:51 +0300 Subject: fix: improve typings --- src/services/waybills/index.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/services/waybills/index.ts') diff --git a/src/services/waybills/index.ts b/src/services/waybills/index.ts index f8a4be6..4e50f54 100644 --- a/src/services/waybills/index.ts +++ b/src/services/waybills/index.ts @@ -1,18 +1,15 @@ import Form from './WaybillForm'; import Panel from './WaybillPanel'; -import { waybillStatusNames, operationNames } from '../constants'; +import { transformOperation, transformStatus } from '../transforms'; +import { ServiceParams } from '../../containers/Service/ServiceContext'; -const service = { +const service: ServiceParams = { route: 'waybills', name: 'Накладные', nameSingular: 'Накладная', tableFields: [ - { - key: 'status', - label: 'Статус', - transform: (status: 'waiting' | 'executed' | 'cancelled') => waybillStatusNames[status], - }, - { key: 'operation', label: 'Операция', transform: (op: 'in' | 'out') => operationNames[op] }, + { key: 'status', label: 'Статус', transform: transformStatus }, + { key: 'operation', label: 'Операция', transform: transformOperation }, { key: 'total', label: 'Сумма' }, { key: 'contractor.name', label: 'Контрагент' }, ], -- cgit v1.2.3