mirror of
				https://github.com/strapi/strapi.git
				synced 2025-10-31 18:08:11 +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;
 | |
| };
 |