Fix types
This commit is contained in:
parent
e9dabd4f1c
commit
89b2958a2f
2 changed files with 5 additions and 4 deletions
|
@ -98,7 +98,9 @@ const CustomerCreatePage: React.FC<CustomerCreatePageProps> = ({
|
|||
})
|
||||
);
|
||||
|
||||
const handleSubmit = (formData: CustomerCreatePageFormData) => {
|
||||
const handleSubmit = (
|
||||
formData: CustomerCreatePageFormData & AddressTypeInput
|
||||
) => {
|
||||
const areAddressInputFieldsModified = ([
|
||||
"city",
|
||||
"companyName",
|
||||
|
@ -115,7 +117,7 @@ const CustomerCreatePage: React.FC<CustomerCreatePageProps> = ({
|
|||
.some(field => field !== "");
|
||||
|
||||
if (areAddressInputFieldsModified) {
|
||||
handleSubmitWithAddress(formData as any);
|
||||
handleSubmitWithAddress(formData);
|
||||
} else {
|
||||
onSubmit({
|
||||
address: null,
|
||||
|
|
|
@ -4,11 +4,10 @@ import { useIntl } from "react-intl";
|
|||
import { WindowTitle } from "@saleor/components/WindowTitle";
|
||||
import useNavigator from "@saleor/hooks/useNavigator";
|
||||
import useNotifier from "@saleor/hooks/useNotifier";
|
||||
import { maybe, transformFormToAddress } from "../../misc";
|
||||
import { maybe } from "../../misc";
|
||||
import CustomerCreatePage from "../components/CustomerCreatePage";
|
||||
import { TypedCreateCustomerMutation } from "../mutations";
|
||||
import { TypedCustomerCreateDataQuery } from "../queries";
|
||||
import { AddressTypeInput } from "../types";
|
||||
import { CreateCustomer } from "../types/CreateCustomer";
|
||||
import { customerListUrl, customerUrl } from "../urls";
|
||||
|
||||
|
|
Loading…
Reference in a new issue