Swell.js doesnt return attributes with custom fields #179
-
Hi, For a customer project I'm using the nuxt-swell package (version "0.2.0"). I'm trying to group attributes together by adding a content field called But when I perform // await swell.products.get('<PRODUCT_SLUG>');
{
attributes: {
length: {
filterable: true,
id: "length",
name: "Lengte (mm)",
type: "number",
value: 600,
visible: true,
// no `attribute_group`
},
...
},
...
} The {
"version": "1.0.15",
"name": "attributes",
"api": "com",
"label": "Attribute",
"plural": "Attributes",
"fields": {
"content": {
"type": "object",
"fields": {
"attribute_group": {
"type": "string",
"public": true,
"content_id": "custom.admin.attribute-fields"
}
}
},
"attributes": {
"type": "object",
"fields": {
"attribute_group": {
"type": "string",
"content_id": "custom.admin.attribute-fields"
}
}
},
"attribute_group": {
"type": "object",
"fields": {
"attribute_group": {
"type": "string",
"content_id": "custom.admin.attribute-fields"
}
}
},
...
},
...
} Is there a way to retrieve custom content fields with the swell.js package? If no, is there another way to group attributes together? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Hello @BramGerrits , Thank you for reporting. This seems to be a gap here that you can not expand and get custom content fields using Swell JS. |
Beta Was this translation helpful? Give feedback.
@BramGerrits Another possible workaround would be to fetch and cache all attributes in your memory at once which would contain
content
fields as well if you enabled content permissions forattributes
model as described below:https://developers.swell.is/guides/opening-content-permissions
Response: