Closed johncorlett-ultracommerce closed 1 year ago
I had the same problem. Solved it by using this plugin: https://github.com/Barelydead/strapi-plugin-populate-deep
In my case with a menu in three levels, I used /menus/1?nested=true&populate=deep,3
./src/extensions/menus/strapi-server.js contains schema:
const customAttrs = { menuItemIcon: { type: 'media', allowedTypes: [ 'images' ], multiple: false, }, menuItemThumbnail: { type: 'media', allowedTypes: [ 'images' ], multiple: false, }, menuItemFeatureImage: { type: 'media', allowedTypes: [ 'images' ], multiple: false, }, };
http://localhost:1337/api/menus/3?populate=* returns:
"items": [ { "id": 17, "order": 0, "title": "Profiles", "url": "/products", "target": null, "createdAt": "2022-12-28T22:01:41.002Z", "updatedAt": "2022-12-29T22:42:09.712Z" },
Changing type to string allows the custom item to appear in the api as a null.