From ef742ea9b2f246f74eae74169675a331679ad41c Mon Sep 17 00:00:00 2001 From: eug-vs Date: Fri, 26 Mar 2021 01:56:04 +0300 Subject: feat: add strong typing where possible --- src/services/waybills/WaybillForm.tsx | 7 ++++--- src/services/waybills/WaybillPanel.tsx | 5 +++-- src/services/waybills/index.ts | 3 ++- 3 files changed, 9 insertions(+), 6 deletions(-) (limited to 'src/services/waybills') diff --git a/src/services/waybills/WaybillForm.tsx b/src/services/waybills/WaybillForm.tsx index c11ab9e..613989f 100644 --- a/src/services/waybills/WaybillForm.tsx +++ b/src/services/waybills/WaybillForm.tsx @@ -7,12 +7,13 @@ import Button from '../../components/Button'; import Select from '../../components/Select'; import Paper from '../../components/Paper'; import hooks from '../../hooks/useAPIClient'; +import { Product, Contractor, Waybill } from '../types'; -const mapper = (item: any) => ({ key: item._id, label: item.name }); +const mapper = (item: Product | Contractor) => ({ key: item._id, label: item.name }); -const WaybillForm: React.FC> = ({ setFieldValue, values }) => { +const WaybillForm: React.FC> = ({ setFieldValue, values }) => { const { data: products } = hooks.products.useList(); const { data: contractors } = hooks.contractors.useList(); @@ -51,7 +52,7 @@ const WaybillForm: React.FC> = ({ setFieldValue, values }) => { /> - {values.records.map((record: any, index: number) => ( + {values.records.map((record, index) => (