Added some additional save indiactors BOD-134
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Form, notification } from "antd";
|
||||
import React from "react";
|
||||
import React, { useState } from "react";
|
||||
import { useMutation } from "@apollo/react-hooks";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { UPDATE_OWNER } from "../../graphql/owners.queries";
|
||||
@@ -8,10 +8,11 @@ import OwnerDetailFormComponent from "./owner-detail-form.component";
|
||||
function OwnerDetailFormContainer({ owner, refetch }) {
|
||||
const { t } = useTranslation();
|
||||
const [form] = Form.useForm();
|
||||
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [updateOwner] = useMutation(UPDATE_OWNER);
|
||||
|
||||
const handleFinish = async (values) => {
|
||||
setLoading(true);
|
||||
const result = await updateOwner({
|
||||
variables: { ownerId: owner.id, owner: values },
|
||||
});
|
||||
@@ -32,6 +33,7 @@ function OwnerDetailFormContainer({ owner, refetch }) {
|
||||
if (refetch) await refetch();
|
||||
form.resetFields();
|
||||
form.resetFields();
|
||||
setLoading(false);
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -42,7 +44,7 @@ function OwnerDetailFormContainer({ owner, refetch }) {
|
||||
layout="vertical"
|
||||
initialValues={owner}
|
||||
>
|
||||
<OwnerDetailFormComponent form={form} />
|
||||
<OwnerDetailFormComponent loading={loading} form={form} />
|
||||
</Form>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user