fix(product): change export name of ProductImage (#10326)
Change export of `Image` to `ProductImage` to match the data model's name.
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@medusajs/product": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix(product): change export name of ProductImage
|
||||||
@@ -5,7 +5,7 @@ import {
|
|||||||
} from "@medusajs/framework/utils"
|
} from "@medusajs/framework/utils"
|
||||||
import { SqlEntityManager } from "@mikro-orm/postgresql"
|
import { SqlEntityManager } from "@mikro-orm/postgresql"
|
||||||
import {
|
import {
|
||||||
Image,
|
ProductImage,
|
||||||
Product,
|
Product,
|
||||||
ProductCategory,
|
ProductCategory,
|
||||||
ProductCollection,
|
ProductCollection,
|
||||||
@@ -133,7 +133,7 @@ export async function createImages(
|
|||||||
imagesData: string[]
|
imagesData: string[]
|
||||||
) {
|
) {
|
||||||
const images: any[] = imagesData.map((img) => {
|
const images: any[] = imagesData.map((img) => {
|
||||||
return manager.create(toMikroORMEntity(Image), { url: img })
|
return manager.create(toMikroORMEntity(ProductImage), { url: img })
|
||||||
})
|
})
|
||||||
|
|
||||||
await manager.persistAndFlush(images)
|
await manager.persistAndFlush(images)
|
||||||
|
|||||||
+4
-4
@@ -12,7 +12,7 @@ import {
|
|||||||
ProductStatus,
|
ProductStatus,
|
||||||
} from "@medusajs/framework/utils"
|
} from "@medusajs/framework/utils"
|
||||||
import {
|
import {
|
||||||
Image,
|
ProductImage,
|
||||||
Product,
|
Product,
|
||||||
ProductCategory,
|
ProductCategory,
|
||||||
ProductCollection,
|
ProductCollection,
|
||||||
@@ -1345,17 +1345,17 @@ moduleIntegrationTestRunner<IProductModuleService>({
|
|||||||
const manager = MikroOrmWrapper.forkManager()
|
const manager = MikroOrmWrapper.forkManager()
|
||||||
|
|
||||||
const images = [
|
const images = [
|
||||||
manager.create(Image, {
|
manager.create(ProductImage, {
|
||||||
product_id: product.id,
|
product_id: product.id,
|
||||||
url: "image-one",
|
url: "image-one",
|
||||||
rank: 1,
|
rank: 1,
|
||||||
}),
|
}),
|
||||||
manager.create(Image, {
|
manager.create(ProductImage, {
|
||||||
product_id: product.id,
|
product_id: product.id,
|
||||||
url: "image-two",
|
url: "image-two",
|
||||||
rank: 0,
|
rank: 0,
|
||||||
}),
|
}),
|
||||||
manager.create(Image, {
|
manager.create(ProductImage, {
|
||||||
product_id: product.id,
|
product_id: product.id,
|
||||||
url: "image-three",
|
url: "image-three",
|
||||||
rank: 2,
|
rank: 2,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
export { default as Product } from "./product"
|
export { default as Product } from "./product"
|
||||||
export { default as ProductCategory } from "./product-category"
|
export { default as ProductCategory } from "./product-category"
|
||||||
export { default as ProductCollection } from "./product-collection"
|
export { default as ProductCollection } from "./product-collection"
|
||||||
export { default as Image } from "./product-image"
|
export { default as ProductImage } from "./product-image"
|
||||||
export { default as ProductOption } from "./product-option"
|
export { default as ProductOption } from "./product-option"
|
||||||
export { default as ProductOptionValue } from "./product-option-value"
|
export { default as ProductOptionValue } from "./product-option-value"
|
||||||
export { default as ProductTag } from "./product-tag"
|
export { default as ProductTag } from "./product-tag"
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
Product,
|
Product,
|
||||||
ProductCategory,
|
ProductCategory,
|
||||||
ProductCollection,
|
ProductCollection,
|
||||||
Image as ProductImage,
|
ProductImage,
|
||||||
ProductOption,
|
ProductOption,
|
||||||
ProductOptionValue,
|
ProductOptionValue,
|
||||||
ProductTag,
|
ProductTag,
|
||||||
|
|||||||
Reference in New Issue
Block a user