11 lines
296 B
JavaScript
Raw Normal View History

2015-10-22 17:54:43 +02:00
/**
* 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;
};