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
Error: Relations [products] are not valid - Trying to expand products when calling categories api #7131
Comments
Could you give more context such as your medusajs version? |
Here are my dependencies, it should the most recent version:
|
Could we have a small reproduction of this repo so we could see how you're using the medusa API? |
Yes this is happening here too, Adding products to a category is successful but it does not return the existing products or added products. You have to use the store apis to see the products in the category. package versions
|
Yeah i figured, it's strange because there is already a table with their relation in the database so i assumed it does work |
Also do you have the |
Just checked, no it doesnt return in my response nor do some of the data mentioned in the documentation response json |
It might have something to do with the allowedAdminProductCategoryRelations on the admin list product categories endpoint not including the products relation. https://github.com/medusajs/medusa/blob/f03a8222534ce98ad3ea84316fa44a5ce392e1b9/packages/medusa/src/api/routes/admin/product-categories/index.ts#L136C14-L136C50 |
Hello!
Currently i have enabled the beta feature categories in the medusajs panel, and have added the needed categories/subcategories in my project, and have called those categories in the medusajs api.
However when i am trying to query the expand in the categories list function, in here for example:
I get this error in the medusa logs:
However i do see a product_categories_product table in the postgres database that has both the category id and the product id
any ideas?
The text was updated successfully, but these errors were encountered: