Skip to content

Commit

Permalink
Fix: post count query
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-sumi-k committed Feb 20, 2024
1 parent 3427529 commit dcadfce
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions admin/src/api/post/controllers/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,10 @@ module.exports = createCoreController("api::post.post", ({ strapi }) => ({
},

async find(ctx) {
const count = await strapi
.query("api::post.post")
.count({ where: { is_resource: ctx.query.filters.is_resource } });
const count = await strapi.entityService.count("api::post.post", {
filters: ctx.query.filters,
publicationState: ctx.query.publicationState,
});

const posts = await strapi.entityService.findMany("api::post.post", {
filters: ctx.query.filters,
Expand Down

0 comments on commit dcadfce

Please sign in to comment.