System Information
- Strapi Version: v4:
- Operating System: windows:
- Database: mysql:
- **Node Version: 16.13 **:
- NPM Version: 8.1.4:
Hi all, I am trying to get the data only posted using Entity Service API (CRUD operations with Entity Service API - Strapi Developer Docs) . Supposedly by default it is live. but when I check the information it is giving me both published and draft.
I show the code made.
const entries = await strapi.entityService.findMany("api::course.course", {
fields: ["name", "slug", "duration"],
// filters: { slug: slug },
populate: {
chapters: {
fields: ["title", "number"],
sort: { number: "ASC" },
publicationState: "live",
populate: {
resources: {
sort: { number: "ASC" },
fields: ["title", "type", "number"],
},
},
},
},
});
ctx.body = entries;
},