mirror of
https://github.com/strapi/strapi.git
synced 2025-07-20 23:47:46 +00:00
11 lines
296 B
JavaScript
11 lines
296 B
JavaScript
![]() |
/**
|
||
|
* Count entries of a model.
|
||
|
*/
|
||
|
|
||
|
module.exports = function * () {
|
||
|
const Model = strapi.hooks.blueprints.actionUtil.parseModel(this);
|
||
|
const countQuery = Model.count().where(strapi.hooks.blueprints.actionUtil.parseCriteria(this));
|
||
|
const count = yield countQuery;
|
||
|
this.body = count;
|
||
|
};
|