mirror of
				https://github.com/strapi/strapi.git
				synced 2025-10-31 18:08:11 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			21 lines
		
	
	
		
			538 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			538 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| 'use strict';
 | |
| 
 | |
| const { getService } = require('../utils');
 | |
| 
 | |
| module.exports = {
 | |
|   getInitData(ctx) {
 | |
|     const { toDto } = getService('data-mapper');
 | |
|     const { findAllComponents } = getService('components');
 | |
|     const { getAllFieldSizes } = getService('field-sizes');
 | |
|     const { findAllContentTypes } = getService('content-types');
 | |
| 
 | |
|     ctx.body = {
 | |
|       data: {
 | |
|         fieldSizes: getAllFieldSizes(),
 | |
|         components: findAllComponents().map(toDto),
 | |
|         contentTypes: findAllContentTypes().map(toDto),
 | |
|       },
 | |
|     };
 | |
|   },
 | |
| };
 | 
