From e371759af6c218f18edc7a7dca8ba7b55cc367fb Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sat, 17 Apr 2021 14:55:08 +0300 Subject: feat: initialize filters based on query string --- src/services/transfers/index.ts | 5 ++++- src/services/waybills/index.ts | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'src/services') diff --git a/src/services/transfers/index.ts b/src/services/transfers/index.ts index 3feb6e2..de75d53 100644 --- a/src/services/transfers/index.ts +++ b/src/services/transfers/index.ts @@ -15,7 +15,10 @@ const service: ServiceParams = { { key: 'operation', label: 'Операция', transform: transformOperation }, { key: 'amount', label: 'Сумма' }, ], - filters: ['operation', 'contractor.name'], + filters: [ + { key: 'operation', label: 'Операция', transform: transformOperation }, + { key: 'contractor._id', label: 'Контрагент', as: 'contractor.name' }, + ], actions: [ { name: 'Загрузить выписку', diff --git a/src/services/waybills/index.ts b/src/services/waybills/index.ts index ae1c8d3..08f43fc 100644 --- a/src/services/waybills/index.ts +++ b/src/services/waybills/index.ts @@ -14,7 +14,11 @@ const service: ServiceParams = { { key: 'total', label: 'Сумма' }, { key: 'contractor.name', label: 'Контрагент' }, ], - filters: ['status', 'operation', 'contractor.name'], + filters: [ + { key: 'status', label: 'Статус', transform: transformStatus }, + { key: 'operation', label: 'Операция', transform: transformOperation }, + { key: 'contractor._id', label: 'Контрагент', as: 'contractor.name' }, + ], default: { operation: 'in', records: [], -- cgit v1.2.3