mirror of
				https://github.com/strapi/strapi.git
				synced 2025-10-31 09:56:44 +00:00 
			
		
		
		
	refactor(content-manager): entity manager support single types
This commit is contained in:
		
							parent
							
								
									006a531e85
								
							
						
					
					
						commit
						de5d6b5a8c
					
				| @ -88,7 +88,13 @@ module.exports = ({ strapi }) => ({ | |||||||
| 
 | 
 | ||||||
|     const entities = await strapi.entityService.findMany(uid, params); |     const entities = await strapi.entityService.findMany(uid, params); | ||||||
| 
 | 
 | ||||||
|     const mappedResults = await mapAsync(entities.results, (entity) => this.mapEntity(entity, uid)); |     if (!entities) { | ||||||
|  |       return entities; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     const mappedResults = await mapAsync(entities.results || [entities], (entity) => | ||||||
|  |       this.mapEntity(entity, uid) | ||||||
|  |     ); | ||||||
|     return { ...entities, results: mappedResults }; |     return { ...entities, results: mappedResults }; | ||||||
|   }, |   }, | ||||||
| 
 | 
 | ||||||
| @ -97,7 +103,13 @@ module.exports = ({ strapi }) => ({ | |||||||
| 
 | 
 | ||||||
|     const entities = await strapi.entityService.findPage(uid, params); |     const entities = await strapi.entityService.findPage(uid, params); | ||||||
| 
 | 
 | ||||||
|     const mappedResults = await mapAsync(entities.results, (entity) => this.mapEntity(entity, uid)); |     if (!entities) { | ||||||
|  |       return entities; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     const mappedResults = await mapAsync(entities.results || [entities], (entity) => | ||||||
|  |       this.mapEntity(entity, uid) | ||||||
|  |     ); | ||||||
|     return { ...entities, results: mappedResults }; |     return { ...entities, results: mappedResults }; | ||||||
|   }, |   }, | ||||||
| 
 | 
 | ||||||
| @ -107,7 +119,13 @@ module.exports = ({ strapi }) => ({ | |||||||
| 
 | 
 | ||||||
|     const entities = await strapi.entityService.findWithRelationCountsPage(uid, params); |     const entities = await strapi.entityService.findWithRelationCountsPage(uid, params); | ||||||
| 
 | 
 | ||||||
|     const mappedResults = await mapAsync(entities.results, (entity) => this.mapEntity(entity, uid)); |     if (!entities) { | ||||||
|  |       return entities; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     const mappedResults = await mapAsync(entities.results || [entities], (entity) => | ||||||
|  |       this.mapEntity(entity, uid) | ||||||
|  |     ); | ||||||
|     return { ...entities, results: mappedResults }; |     return { ...entities, results: mappedResults }; | ||||||
|   }, |   }, | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Jamie Howard
						Jamie Howard