diff options
Diffstat (limited to 'src/containers/WaybillForm.tsx')
-rw-r--r-- | src/containers/WaybillForm.tsx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/containers/WaybillForm.tsx b/src/containers/WaybillForm.tsx index a6a37e2..5fcdb7d 100644 --- a/src/containers/WaybillForm.tsx +++ b/src/containers/WaybillForm.tsx @@ -17,7 +17,7 @@ const WaybillForm: React.FC<FormikProps> = ({ setFieldValue, values }) => { const { data: contractors } = hooks.contractors.useList(); if (!values.date) setFieldValue('date', moment().format('YYYY-MM-DD')); - if (!values.contractorId && contractors) setFieldValue('contractorId', contractors[0]._id); + if (!values.contractorId && contractors?.length) setFieldValue('contractorId', contractors[0]._id); const handleAddRecord = () => setFieldValue('records', [...values.records, { productId: _.map(products, '_id').reduce((acc, id) => { |