mirror of
				https://github.com/strapi/strapi.git
				synced 2025-10-31 01:47:13 +00:00 
			
		
		
		
	fix: check if it ends with _cmps
This commit is contained in:
		
							parent
							
								
									5985207d3b
								
							
						
					
					
						commit
						6ecc67b1e9
					
				| @ -337,18 +337,7 @@ const filterValidRelationalAttributes = (attributes: Record<string, any>) => { | |||||||
|     return attribute.owner || (!attribute.mappedBy && !attribute.morphBy); |     return attribute.owner || (!attribute.mappedBy && !attribute.morphBy); | ||||||
|   }; |   }; | ||||||
| 
 | 
 | ||||||
|   const isComponentLike = (attribute: any) => { |   const isComponentLike = (attribute: any) => attribute.joinTable?.name.endsWith('_cmps'); | ||||||
|     return ( |  | ||||||
|       /** |  | ||||||
|        * probably can remove attribute.component & attribute.components |  | ||||||
|        * to be checked |  | ||||||
|        *  */ |  | ||||||
|       attribute.component || |  | ||||||
|       attribute.components || |  | ||||||
|       attribute.joinTable?.name.includes('components') || |  | ||||||
|       attribute.joinTable?.name.includes('cmps') |  | ||||||
|     ); |  | ||||||
|   }; |  | ||||||
| 
 | 
 | ||||||
|   return Object.entries(attributes) |   return Object.entries(attributes) | ||||||
|     .filter(([, attribute]) => { |     .filter(([, attribute]) => { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Bassel Kanso
						Bassel Kanso