#TypeScript Admin API problem (Type '"published"' is not assignable to type 'ProductStatus'.ts(2322))

6 messages · Page 1 of 1 (latest)

round granite
#

I am trying to filter down to products that are published. However, I'm getting the TypeScript error "Type '"published"' is not assignable to type 'ProductStatus'.ts(2322)" when attempting to make this call:

const response = await medusa.admin.products.list({ status: ["published"] });

I'm confused because "published" is one of the allowable values. How should I resolve this?

solar topaz
#

ProductStatus is an enum you send an array of strings

round granite
hoary comet
#

I think you don't send it as array....

solar topaz
#

😦

#

ProductStatus.PUBLISHED