Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Type improvements

dominik-zeglend79c28b0a9c3
diff --git a/saleor/static/dashboard-next/index.tsx b/saleor/static/dashboard-next/index.tsx
index 87a6b9eb15..d62066520e 100644
--- a/saleor/static/dashboard-next/index.tsx
+++ b/saleor/static/dashboard-next/index.tsx
@@ -76,7 +76,7 @@ export interface UserError {
// These interfaces are used in atomic mutation providers, which then are
// combined into one compound mutation provider
-export interface PartialMutationProviderProps<T extends {}> {
+export interface PartialMutationProviderProps<T extends {} = {}> {
onSuccess?: (data: T) => void;
onError?: (error: ApolloError) => void;
}
diff --git a/saleor/static/dashboard-next/products/containers/ProductUpdateOperations.tsx b/saleor/static/dashboard-next/products/containers/ProductUpdateOperations.tsx
index 5ddf36bb59..83ce85a76c 100644
--- a/saleor/static/dashboard-next/products/containers/ProductUpdateOperations.tsx
+++ b/saleor/static/dashboard-next/products/containers/ProductUpdateOperations.tsx
@@ -1,6 +1,5 @@
import * as React from "react";
-import { ApolloError } from "apollo-client";
import {
MutationProviderProps,
MutationProviderRenderProps,
@@ -32,12 +31,10 @@ import ProductUpdateProvider from "./ProductUpdate";
interface ProductDeleteProviderProps
extends PartialMutationProviderProps<ProductDeleteMutation> {
productId: string;
- children: ((
- props: PartialMutationProviderRenderProps<
- ProductDeleteMutation,
- ProductDeleteMutationVariables
- >
- ) => React.ReactElement<any>);
+ children: PartialMutationProviderRenderProps<
+ ProductDeleteMutation,
+ ProductDeleteMutationVariables
+ >;
}
const ProductDeleteProvider: React.StatelessComponent<
@@ -63,12 +60,10 @@ const ProductDeleteProvider: React.StatelessComponent<
interface ProductImageCreateProviderProps
extends PartialMutationProviderProps<ProductImageCreateMutation> {
productId: string;
- children: ((
- props: PartialMutationProviderRenderProps<
- ProductImageCreateMutation,
- ProductImageCreateMutationVariables
- >
- ) => React.ReactElement<any>);
+ children: PartialMutationProviderRenderProps<
+ ProductImageCreateMutation,
+ ProductImageCreateMutationVariables
+ >;
}
const ProductImageCreateProvider: React.StatelessComponent<
diff --git a/saleor/static/dashboard-next/products/views/ProductUpdate.tsx b/saleor/static/dashboard-next/products/views/ProductUpdate.tsx
index d434723e93..ce7c65fc92 100644
--- a/saleor/static/dashboard-next/products/views/ProductUpdate.tsx
+++ b/saleor/static/dashboard-next/products/views/ProductUpdate.tsx
@@ -1,6 +1,7 @@
import * as React from "react";
import { arrayMove } from "react-sortable-hoc";
+import { ApolloError } from "apollo-client";
import * as placeholderImg from "../../../images/placeholder255x255.png";
import { categoryShowUrl } from "../../categories";
import ErrorMessageCard from "../../components/ErrorMessageCard";
@@ -11,7 +12,6 @@ import ProductUpdatePage from "../components/ProductUpdatePage";
import ProductUpdateOperations from "../containers/ProductUpdateOperations";
import { productListUrl, productVariantEditUrl } from "../index";
import { productDetailsQuery, TypedProductDetailsQuery } from "../queries";
-import { ApolloError } from "apollo-client";
interface ProductUpdateProps {
id: string;