mirror of
https://github.com/strapi/strapi.git
synced 2025-07-19 07:02:26 +00:00
13 lines
311 B
JavaScript
13 lines
311 B
JavaScript
'use strict';
|
|
|
|
/**
|
|
* 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;
|
|
};
|