mirror of
https://github.com/strapi/strapi.git
synced 2025-07-22 08:26:44 +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;
|
|
};
|