Hi I have a problem with a reference not including value in the visual editor. When I open the page im draft preview the reference is populated correctly.
Visual editor console:
{
"@type": "@builder.io/core:Reference",
"id": "fc2bbeb07092495b8ea7f1a49a705096",
"model": "category"
// "value" key missing
}
Draft preview console:
{
"@type": "@builder.io/core:Reference",
"id": "fc2bbeb07092495b8ea7f1a49a705096",
"model": "category",
"value": {
"data": {
"title": "Article"
},
}
// More props...
}
This is the component schema:
Builder.registerComponent(LazyContentDisplay, {
name: "ContentDisplay",
inputs: [
{
name: "items",
type: "list",
subFields: [
{
name: "categories",
type: "list",
subFields: [
{
name: "category",
type: "reference",
model: "category",
},
],
},
// More fields ...
],
},
// I tried the top level reference field, but it also doesn't work
// {
// name: "test",
// type: "reference",
// model: "category",
// },
],
})
Basically I want to have a list of all categories used by items and because of this issue it’s working only in the app but not in visual editor.
I know I can fetch all the categories and map them to ids but I wonder if there’s a cleaner way to do it.
Is there a way to make it work?