summaryrefslogtreecommitdiff
path: root/src/containers/Service/ServiceItem.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/containers/Service/ServiceItem.tsx')
-rw-r--r--src/containers/Service/ServiceItem.tsx4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/containers/Service/ServiceItem.tsx b/src/containers/Service/ServiceItem.tsx
index 22357c7..f833227 100644
--- a/src/containers/Service/ServiceItem.tsx
+++ b/src/containers/Service/ServiceItem.tsx
@@ -4,6 +4,7 @@ import { Formik } from 'formik';
import _ from 'lodash';
import Page, { Action } from '../Page';
import hooks from '../../hooks/useAPIClient';
+import useQuery from '../../hooks/useQuery';
import { post, patch, del } from '../../requests';
import ServiceContext from './ServiceContext';
@@ -14,6 +15,7 @@ interface Params {
const ServiceItem: React.FC = () => {
const service = useContext(ServiceContext);
const history = useHistory();
+ const query = useQuery();
const { id } = useParams<Params>();
const { data: item, mutate } = hooks[service.route].useItem(id);
@@ -44,7 +46,7 @@ const ServiceItem: React.FC = () => {
>
{(!id || item) && (
<Formik
- initialValues={_.defaults(item, service.default)}
+ initialValues={_.defaults(item, query, service.default)}
onSubmit={onSubmit}
children={service.Form}
/>