Skip to content

Commit a857786

Browse files
authored
fix(product, types): add missing types for variant images and thumbnails (#14026)
## Summary **What** — What changes are introduced in this PR? - Add missing `images` field of variants to the HTTP types - Add missing `thumbnail` field to product variant schema, which leads to the thumbnail missing from auto generated types **Why** — Why are these changes relevant or necessary? *Please provide answer here* **How** — How have these changes been implemented? *Please provide answer here* **Testing** — How have these changes been tested, or how can the reviewer test the feature? *Please provide answer here* --- ## Examples Provide examples or code snippets that demonstrate how this feature works, or how it can be used in practice. This helps with documentation and ensures maintainers can quickly understand and verify the change. ```ts // Example usage ``` --- ## Checklist Please ensure the following before requesting a review: - [ ] I have added a **changeset** for this PR - Every non-breaking change should be marked as a **patch** - To add a changeset, run `yarn changeset` and follow the prompts - [ ] The changes are covered by relevant **tests** - [ ] I have verified the code works as intended locally - [ ] I have linked the related issue(s) if applicable --- ## Additional Context Add any additional context, related issues, or references that might help the reviewer understand this PR.
1 parent c93f77d commit a857786

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

.changeset/warm-groups-lay.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@medusajs/product": patch
3+
"@medusajs/types": patch
4+
---
5+
6+
fix(product, types): add missing types for variant images and thumbnails

packages/core/types/src/http/product/admin/entitites.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,6 @@ export interface AdminProductVariant extends BaseProductVariant {
5959
* The variant's inventory items.
6060
*/
6161
inventory_items?: AdminProductVariantInventoryItemLink[] | null
62-
63-
/**
64-
* The variant's images.
65-
*/
66-
images?: AdminProductImage[] | null
6762
}
6863
export interface AdminProductOption extends BaseProductOption {
6964
/**

packages/core/types/src/http/product/common.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,10 @@ export interface BaseProductVariant {
163163
* The variant's thumbnail.
164164
*/
165165
thumbnail: string | null
166+
/**
167+
* The variant's images.
168+
*/
169+
images: BaseProductImage[] | null
166170
/**
167171
* Whether the variant can be ordered even if it's out of stock.
168172
*/

packages/modules/product/src/schema/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ type ProductVariant {
6060
width: Float
6161
options: [ProductOptionValue!]!
6262
images: [ProductImage!]!
63+
thumbnail: String
6364
metadata: JSON
6465
product: Product
6566
product_id: String

0 commit comments

Comments
 (0)