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

[Bug]: Cannot filter products by array of handles #11555

Closed
fxmb opened this issue Feb 21, 2025 · 1 comment
Closed

[Bug]: Cannot filter products by array of handles #11555

fxmb opened this issue Feb 21, 2025 · 1 comment

Comments

@fxmb
Copy link

fxmb commented Feb 21, 2025

Package.json file

medusa 2.4.0

Node.js version

20

Database and its version

16

Operating system name and version

Mac

Browser name

No response

What happended?

Why does this query throw an error:

      const existingProducts = await medusa.admin.product.list({
        handle: [...enrichedProducts.map((product) => product.handle)],
      });

Error:

error:   Invalid request: Expected type: 'string' for field 'handle', got: 'array'
MedusaError: Invalid request: Expected type: 'string' for field 'handle', got: 'array'

In the docs it clearly states either string or array of handles?!
https://docs.medusajs.com/api/admin#products_getproducts

Expected behavior

Return array of products filtered by the handle filter array

Actual behavior

Error

Link to reproduction repo

na

@riqwan
Copy link
Contributor

riqwan commented Feb 21, 2025

Hey @fxmb, this was merged this week https://github.com/medusajs/medusa/pull/11472/files

Should be available in the next release. You can use the "preview" tag to access it now.

@riqwan riqwan closed this as completed Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants