Hi all,
I am trying to get the data from a relationship in a repeatable zone in a slice i have made.
My slice has a repeatable zone with a relationship.
Slice model looks like this:
{
"id": "testimonial_grid",
"type": "SharedSlice",
"name": "TestimonialGrid",
"description": "TestimonialGrid",
"variations": [
{
"id": "default",
"name": "Default",
"docURL": "...",
"version": "sktwi1xtmkfgx8626",
"description": "TestimonialGrid",
"primary": {
"title": {
"type": "StructuredText",
"config": {
"single": "heading1",
"label": "Title",
"placeholder": "This is where it all begins..."
}
},
"description": {
"type": "StructuredText",
"config": {
"single": "paragraph",
"label": "Description",
"placeholder": "A nice description of your feature"
}
}
},
"items": {
"tesimonial": {
"type": "Link",
"config": {
"label": "Tesimonial",
"select": "document",
"customtypes": [
"testimonial"
]
}
}
},
"imageUrl": "https://images.prismic.io/slice-machine/621a5ec4-0387-4bc5-9860-2dd46cbc07cd_default_ss.png?auto=compress,format"
}
]
}
i have a content type called testimonial which looks like this:
{
"id": "testimonial",
"label": "Testimonial",
"repeatable": true,
"status": true,
"json": {
"Main": {
"uid": {
"type": "UID",
"config": {
"label": "Uid",
"placeholder": ""
}
},
"company": {
"type": "Text",
"config": {
"label": "Company",
"placeholder": ""
}
},
"name": {
"type": "Text",
"config": {
"label": "Name",
"placeholder": ""
}
},
"role": {
"type": "Text",
"config": {
"label": "Role",
"placeholder": ""
}
},
"avatar": {
"type": "Image",
"config": {
"label": "Avatar",
"constraint": {
"width": 100,
"height": 100
},
"thumbnails": []
}
},
"quote": {
"type": "StructuredText",
"config": {
"label": "Quote",
"placeholder": "",
"allowTargetBlank": true,
"single": "paragraph,strong"
}
},
"link": {
"type": "Link",
"config": {
"label": "Link",
"placeholder": "",
"select": null
}
}
}
}
}
when i log out the following in my slice
{slice.items.map((item) => {
return <>{item.data.name}</>;
})}
data is not in the payload.
any ideas on how to add this to my slice? Can i add queries in the slice to enrish the payload (using fetchLinks etc...)
Thanks!