From 1a3843a92a6db83b9249e9c0aece7b3d13a600a9 Mon Sep 17 00:00:00 2001 From: Harminder Virk Date: Thu, 13 Feb 2025 20:53:35 +0530 Subject: [PATCH] fix: listVariantsList types (#11441) --- .changeset/nervous-dryers-swim.md | 5 +++++ packages/core/types/src/product/common.ts | 22 +++++++++++++++++----- 2 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 .changeset/nervous-dryers-swim.md diff --git a/.changeset/nervous-dryers-swim.md b/.changeset/nervous-dryers-swim.md new file mode 100644 index 0000000000..ab4bfdc5ee --- /dev/null +++ b/.changeset/nervous-dryers-swim.md @@ -0,0 +1,5 @@ +--- +"@medusajs/types": patch +--- + +fix: listVariantsList types diff --git a/packages/core/types/src/product/common.ts b/packages/core/types/src/product/common.ts index 3969fc5d1a..edad5a1cba 100644 --- a/packages/core/types/src/product/common.ts +++ b/packages/core/types/src/product/common.ts @@ -726,8 +726,13 @@ export interface FilterableProductProps * Filters on a product's variant properties. */ variants?: { - options?: { value: string; option_id: string } + options?: { + value?: string + option_id?: string + option?: Record + } } + /** * Filter a product by the ID of the associated type */ @@ -899,22 +904,29 @@ export interface FilterableProductVariantProps * Search through the title and different code attributes on the variant */ q?: string + /** * The IDs to filter product variants by. */ - id?: string | string[] + id?: string | string[] | OperatorMap + /** * The SKUs to filter product variants by. */ - sku?: string | string[] + sku?: string | string[] | OperatorMap /** * Filter the product variants by their associated products' IDs. */ - product_id?: string | string[] + product_id?: string | string[] | OperatorMap + /** * Filter product variants by their associated options. */ - options?: Record + options?: { + value?: string + option_id?: string + option?: Record + } } /**