mirror of
				https://github.com/strapi/strapi.git
				synced 2025-10-31 18:08:11 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			17 lines
		
	
	
		
			360 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			360 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| 'use strict';
 | |
| 
 | |
| const MANY_RELATIONS = ['oneToMany', 'manyToMany', 'manyWay'];
 | |
| 
 | |
| const getRelationalFields = contentType => {
 | |
|   return Object.keys(contentType.attributes).filter(attributeName => {
 | |
|     return contentType.attributes[attributeName].type === 'relation';
 | |
|   });
 | |
| };
 | |
| 
 | |
| module.exports = {
 | |
|   getRelationalFields,
 | |
|   constants: {
 | |
|     MANY_RELATIONS,
 | |
|   },
 | |
| };
 | 
