diff options
Diffstat (limited to 'src/containers/Service/ServiceForm.tsx')
-rw-r--r-- | src/containers/Service/ServiceForm.tsx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/containers/Service/ServiceForm.tsx b/src/containers/Service/ServiceForm.tsx index 273f5bd..62e4521 100644 --- a/src/containers/Service/ServiceForm.tsx +++ b/src/containers/Service/ServiceForm.tsx @@ -1,6 +1,7 @@ import React, { useContext } from 'react'; import { useParams, useHistory } from 'react-router-dom'; import { Formik } from 'formik'; +import _ from 'lodash'; import Page, { Action } from '../Page'; import hooks from '../../hooks/useAPIClient'; import { post, patch } from '../../requests'; @@ -32,7 +33,7 @@ const ServiceForm: React.FC = () => { <Page title={id ? item?.name : `Новый ${service.nameSingular}`} actions={actions}> {(!id || item) && ( <Formik - initialValues={item || { name: '', debt: '', vatId: '' }} + initialValues={_.defaults(item, service.default)} onSubmit={onSubmit} > <service.Form /> |