In my data structure, there are four levels of nesting specified, but only two are being returned.
Request:
const data = await got.get('http://localhost:1337/api/courses?locale=ru&populate=*', {
headers: {
Authorization:
'Bearer b497e21fd3e11957384e82086ec4b3a2e2c60dd8165ae57b7071446a492203945ad9baf2cff12b3f4801bfe2b940f059245e1f959fbac413e9edcabcfdb3376c3ee5acba47444cca85e01eeb063d8fc465083dbc178f795c6d139686b9daad62189315ba7640bbe12310805d70879f9c6679b8b377491acf7e9a681a8b5d19dr',
}
}).json();
Response:
{
"status": 200,
"body": [
{
"data": [
{
"id": 2,
"attributes": {
"title": "Course (1)",
"description": "1",
"createdAt": "2023-11-22T20:34:07.662Z",
"updatedAt": "2023-11-22T21:04:34.291Z",
"publishedAt": "2023-11-22T20:36:03.008Z",
"locale": "ru",
"modules": {
"data": [
{
"id": 2,
"attributes": {
"title": "Module (2)",
"description": "Охота",
"createdAt": "2023-11-22T20:34:49.212Z",
"updatedAt": "2023-11-22T21:04:43.479Z",
"publishedAt": "2023-11-22T20:37:15.024Z",
"locale": "ru"
}
}
]
},
"localizations": {
"data": [
{
"id": 1,
"attributes": {
"title": "Course",
"description": "All day testing",
"createdAt": "2023-11-22T18:34:14.658Z",
"updatedAt": "2023-11-22T21:03:00.811Z",
"publishedAt": "2023-11-22T19:41:36.159Z",
"locale": "en"
}
}
]
}
}
}
],
"meta": {
"pagination": {
"page": 1,
"pageSize": 25,
"pageCount": 1,
"total": 1
}
}
}
]
}
Actual:
Couse (1) → Module (2):
Expected:
Couse (1) → Module (2) → Lesson (3) → Topic (4):
How to return all nested levels?