Skip to content

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

Update types

dominik-zeglen10c3ed575b68
diff --git a/saleor/static/dashboard-next/collections/components/CollectionCreatePage/CollectionCreatePage.tsx b/saleor/static/dashboard-next/collections/components/CollectionCreatePage/CollectionCreatePage.tsx
index 049c15ffa3..f3568e024c 100644
--- a/saleor/static/dashboard-next/collections/components/CollectionCreatePage/CollectionCreatePage.tsx
+++ b/saleor/static/dashboard-next/collections/components/CollectionCreatePage/CollectionCreatePage.tsx
@@ -115,13 +115,13 @@ const CollectionCreatePage = withStyles(styles, {
}
} as any)
}
- onImageUpload={event =>
+ onImageUpload={file =>
change({
target: {
name: "backgroundImage",
value: {
- url: URL.createObjectURL(event.target.files[0]),
- value: event.target.files[0]
+ url: URL.createObjectURL(file),
+ value: file
}
}
} as any)
diff --git a/saleor/static/dashboard-next/collections/components/CollectionImage/CollectionImage.tsx b/saleor/static/dashboard-next/collections/components/CollectionImage/CollectionImage.tsx
index 555c8e9e0d..853847d71b 100644
--- a/saleor/static/dashboard-next/collections/components/CollectionImage/CollectionImage.tsx
+++ b/saleor/static/dashboard-next/collections/components/CollectionImage/CollectionImage.tsx
@@ -95,7 +95,7 @@ export const CollectionImage = withStyles(styles)(
<input
className={classes.fileField}
id="fileUpload"
- onChange={onImageUpload}
+ onChange={event => onImageUpload(event.target.files[0])}
type="file"
ref={this.imgInputAnchor}
/>