medusajs / medusa

Building blocks for digital commerce
https://medusajs.com
MIT License
24.04k stars 2.33k forks source link

ProductCategory image cant be set #7454

Open hrohwer opened 2 months ago

hrohwer commented 2 months ago

Cant set the image in product category :

Console error :

:9000/admin/product-categories/pcat_01HYP2AJ3YZ441FX131569HCZK:1 Failed to load resource: the server responded with a status of 400 (Bad Request)

mutation.js:158 Error: Request failed with status code 400 at e.exports (createError.js:16:15) at e.exports (settle.js:17:12) at XMLHttpRequest._ (xhr.js:66:7)

humbleEwan commented 4 weeks ago

image There is no image field inside product_category table. You would need to extend it but since that is bugged (yes, it is super annoying), what you can do is create an Entity that has a product_category ID and an image or an image array. Now you need a custom endpoint for retrieving the images, but it should work.