refact: removed duplicate table validation
This commit is contained in:
		
							parent
							
								
									113426cbaa
								
							
						
					
					
						commit
						d12453958b
					
				@ -47,19 +47,7 @@ class Node {
 | 
				
			|||||||
    this.type = 'Node'
 | 
					    this.type = 'Node'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (props.tables) {
 | 
					    if (props.tables) {
 | 
				
			||||||
      try {
 | 
					      this.importTables(props.tables)
 | 
				
			||||||
        const validateTablesResponse = this._validateTables(props.tables)
 | 
					 | 
				
			||||||
        if (validateTablesResponse.status === 'ERR') {
 | 
					 | 
				
			||||||
          throw validateTablesResponse
 | 
					 | 
				
			||||||
        } else {
 | 
					 | 
				
			||||||
          let tables = []
 | 
					 | 
				
			||||||
          if (!Array.isArray(props.tables)) tables = [props.tables]
 | 
					 | 
				
			||||||
          else tables = props.tables
 | 
					 | 
				
			||||||
          this.tables = tables
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
      } catch (err) {
 | 
					 | 
				
			||||||
        throw err
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
      this.tables = []
 | 
					      this.tables = []
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user