Skip to content

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

Refresh UI after image removal

dominik-zeglen8259d1f47ff9
diff --git a/saleor/static/dashboard-next/products/containers/ProductUpdateOperations.tsx b/saleor/static/dashboard-next/products/containers/ProductUpdateOperations.tsx
index 905e690314..f22068ea3d 100644
--- a/saleor/static/dashboard-next/products/containers/ProductUpdateOperations.tsx
+++ b/saleor/static/dashboard-next/products/containers/ProductUpdateOperations.tsx
@@ -96,21 +96,7 @@ const ProductImageDeleteProvider: React.StatelessComponent<
data,
error,
loading,
- mutate: opts => {
- const optimisticResponse = {
- productImageDelete: {
- __typename: "ProductImageDelete",
- productImage: {
- __typename: "ProductImage",
- id: opts.variables.id
- }
- }
- };
- return mutate({
- optimisticResponse,
- variables: opts.variables
- });
- }
+ mutate
})
}
</TypedProductImageDeleteMutation>
diff --git a/saleor/static/dashboard-next/products/mutations.ts b/saleor/static/dashboard-next/products/mutations.ts
index bc9d71d0d3..ff9982627a 100644
--- a/saleor/static/dashboard-next/products/mutations.ts
+++ b/saleor/static/dashboard-next/products/mutations.ts
@@ -28,10 +28,7 @@ import {
} from "../gql-types";
import { TypedMutation } from "../mutations";
-import {
- fragmentProduct,
- fragmentVariant
-} from "./queries";
+import { fragmentProduct, fragmentVariant } from "./queries";
export const productImageCreateMutation = gql`
${fragmentProduct}
@@ -273,6 +270,7 @@ export const productImageDeleteMutation = gql`
mutation ProductImageDelete($id: ID!) {
productImageDelete(id: $id) {
product {
+ id
images {
edges {
node {