mirror of
				https://github.com/strapi/strapi.git
				synced 2025-11-04 03:43:34 +00:00 
			
		
		
		
	Merge pull request #17222 from strapi/feature/workflow-return-count-in-meta
This commit is contained in:
		
						commit
						5f46fc52a1
					
				@ -121,16 +121,15 @@ module.exports = {
 | 
			
		||||
    );
 | 
			
		||||
    const { populate, filters, sort } = await sanitizedQuery.read(query);
 | 
			
		||||
 | 
			
		||||
    const workflows = await workflowService.find({
 | 
			
		||||
      populate,
 | 
			
		||||
      filters,
 | 
			
		||||
      sort,
 | 
			
		||||
    });
 | 
			
		||||
    const [workflows, workflowCount] = await Promise.all([
 | 
			
		||||
      workflowService.find({ populate, filters, sort }),
 | 
			
		||||
      workflowService.count(),
 | 
			
		||||
    ]);
 | 
			
		||||
 | 
			
		||||
    ctx.body = {
 | 
			
		||||
      data: await mapAsync(workflows, sanitizeOutput),
 | 
			
		||||
      meta: {
 | 
			
		||||
        workflowCount: workflows.length,
 | 
			
		||||
        workflowCount,
 | 
			
		||||
      },
 | 
			
		||||
    };
 | 
			
		||||
  },
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user