Skip to content

Commit 92d240d

Browse files
authored
fix(medusa): fix type of product variant request param (medusajs#14342)
Fix type argument for requests which is necessary for generating OpenAPI specs ## Why The `StoreVariantListRequest` type used in the `/store/product-variants` route doesn't match the convention of other routes since it doesn't accept a type parameter for the query (or body, but here that's not necessary). This makes it difficult for us to infer the query parameter type of the request. This change would adapt the `StoreVariantListRequest` to match other conventions in our API routes so that we can generate correct OAS for docs
1 parent 1c4c4b8 commit 92d240d

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.changeset/strong-memes-tease.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@medusajs/medusa": patch
3+
---
4+
5+
fix(medusa): fix type of product variant request param

packages/medusa/src/api/store/product-variants/route.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ import { wrapVariantsWithInventoryQuantityForSalesChannel } from "../../utils/mi
1212
import { StoreRequestWithContext } from "../types"
1313
import { wrapVariantsWithTaxPrices } from "./helpers"
1414

15-
type StoreVariantListRequest =
16-
StoreRequestWithContext<HttpTypes.StoreProductVariantParams> &
17-
AuthenticatedMedusaRequest<HttpTypes.StoreProductVariantParams>
15+
type StoreVariantListRequest<T = HttpTypes.StoreProductVariantParams> =
16+
StoreRequestWithContext<T> &
17+
AuthenticatedMedusaRequest<T>
1818

1919
/**
2020
* @since 2.11.2

0 commit comments

Comments
 (0)