fix: load field when source collection not found
This commit is contained in:
		
							parent
							
								
									16ad19b18d
								
							
						
					
					
						commit
						95bec2278f
					
				| @ -298,16 +298,16 @@ export class Collection< | |||||||
|         this.db.logger.warn( |         this.db.logger.warn( | ||||||
|           `source collection "${sourceCollectionName}" not found for field "${name}" at collection "${this.name}"`, |           `source collection "${sourceCollectionName}" not found for field "${name}" at collection "${this.name}"`, | ||||||
|         ); |         ); | ||||||
|       } |  | ||||||
| 
 |  | ||||||
|       const sourceField = sourceCollection.fields.get(sourceFieldName); |  | ||||||
| 
 |  | ||||||
|       if (!sourceField) { |  | ||||||
|         this.db.logger.warn( |  | ||||||
|           `source field "${sourceFieldName}" not found for field "${name}" at collection "${this.name}"`, |  | ||||||
|         ); |  | ||||||
|       } else { |       } else { | ||||||
|         options = { ...lodash.omit(sourceField.options, ['name', 'primaryKey']), ...options }; |         const sourceField = sourceCollection.fields.get(sourceFieldName); | ||||||
|  | 
 | ||||||
|  |         if (!sourceField) { | ||||||
|  |           this.db.logger.warn( | ||||||
|  |             `source field "${sourceFieldName}" not found for field "${name}" at collection "${this.name}"`, | ||||||
|  |           ); | ||||||
|  |         } else { | ||||||
|  |           options = { ...lodash.omit(sourceField.options, ['name', 'primaryKey']), ...options }; | ||||||
|  |         } | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user