Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(product): change export name of ProductImage #10326

Merged
merged 2 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/purple-maps-bow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/product": patch
---

fix(product): change export name of ProductImage
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
} from "@medusajs/framework/utils"
import { SqlEntityManager } from "@mikro-orm/postgresql"
import {
Image,
ProductImage,
Product,
ProductCategory,
ProductCollection,
Expand Down Expand Up @@ -133,7 +133,7 @@ export async function createImages(
imagesData: string[]
) {
const images: any[] = imagesData.map((img) => {
return manager.create(toMikroORMEntity(Image), { url: img })
return manager.create(toMikroORMEntity(ProductImage), { url: img })
})

await manager.persistAndFlush(images)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
ProductStatus,
} from "@medusajs/framework/utils"
import {
Image,
ProductImage,
Product,
ProductCategory,
ProductCollection,
Expand Down Expand Up @@ -1345,17 +1345,17 @@ moduleIntegrationTestRunner<IProductModuleService>({
const manager = MikroOrmWrapper.forkManager()

const images = [
manager.create(Image, {
manager.create(ProductImage, {
product_id: product.id,
url: "image-one",
rank: 1,
}),
manager.create(Image, {
manager.create(ProductImage, {
product_id: product.id,
url: "image-two",
rank: 0,
}),
manager.create(Image, {
manager.create(ProductImage, {
product_id: product.id,
url: "image-three",
rank: 2,
Expand Down
2 changes: 1 addition & 1 deletion packages/modules/product/src/models/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export { default as Product } from "./product"
export { default as ProductCategory } from "./product-category"
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 ProductOptionValue } from "./product-option-value"
export { default as ProductTag } from "./product-tag"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
Product,
ProductCategory,
ProductCollection,
Image as ProductImage,
ProductImage,
ProductOption,
ProductOptionValue,
ProductTag,
Expand Down
Loading