You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to find product variants, the options filter seems to be wrong, the current type is Record<string, string>. But this is not actually correct.
The type definition of the options argument, which is presently set to Record<string, string>, needs to be updated in order to fix the type error in the **productService.listProductVariants** function. The expected structure for product variants is not followed by this definition. To accept an array of objects, each with a value property, we should alter the type instead. The following should be the amended type definition: **type Option = { value: string }; **listProductVariants(params:** { product_id: string; options: Option[] }): Promise<ProductVariant[]>;.** This modification will enable the function to be implemented and used properly by calling it with an array of option objects, such as [{ value: color }, { value: size }], without encountering type errors.
Bug report
Describe the bug
When trying to find product variants, the options filter seems to be wrong, the current type is
Record<string, string>
. But this is not actually correct.The following seems to work as expected, however it does give me a type error, so for now I will use
@ts-expect-error
.Expected behavior
I expected the query to work when providing the required typescript types.
Screenshots
The text was updated successfully, but these errors were encountered: