Can’t seem to get a response with the image, I am using the below to fetch and its getting everything apart from the image for some reason:
Content fetch:
export async function fetchContent(params) {
const reqOptions = {
headers: {
Authorization: ``
}
};
const request = await fetch(http://url.com/api/content?populate=*${params}, reqOptions);
const response = await request.json();
return response;
}
Request:
const content= await fetchContent(&filters[Slug][$eq]=${params.slug});
Response:
[
{
id: 1,
Header: ‘Heading Number One’,
Slug: ‘heading-number-one’,
Summary: ‘Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum…’
},
{
id: 2,
Header: ‘Heading Number Two’,
Slug: ‘heading-number-two’,
Summary: ‘Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum…’
}
]
It should be id,Header,Slug,Summary,Banner
This topic has been created from a Discord post (1282009959738904586) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord