-
Notifications
You must be signed in to change notification settings - Fork 20
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
custom_attributes dropped from response when passing expand options #24
Comments
there is no such relation as
|
Hi, export default async function () {
const imports = (await import(
"@medusajs/medusa/dist/api/routes/store/products/index"
)) as any;
imports.allowedStoreProductsRelations = [
...imports.allowedStoreProductsRelations,
"attribute_values",
"attribute_values.attribute",
"int_attribute_values",
"int_attribute_values.attribute",
];
imports.defaultStoreProductsRelations = [
...imports.defaultStoreProductsRelations,
"attribute_values",
"attribute_values.attribute",
"int_attribute_values",
"int_attribute_values.attribute",
];
} |
So instead of having custom_attributes in the response, I receive int_attribute_values, which is okay for me for now. |
Passing any relation to expand for the storefront products/ API endpoint appears to drop custom_attributes from the response data. Should the inclusion of attribute relations in defaultStoreProductsRelations mean they're always returned?
I've worked around this by handling custom_attributes passed in as a relation to expand:
The text was updated successfully, but these errors were encountered: