componentDidMount() {

    this.setState({isRendered: false});

      axios
      .get("http://localhost:5000/record/")
      .then((response) => {
        this.setState({ records: response.data });

        for(var i in response.data){         
          let entry = {};

          entry.flight_from = response.data[i].flight_from
          entry.flight_to = response.data[i].flight_to
          entry.flight_date = response.data[i].flight_date
          entry.cabin = response.data[i].cabin
          entry.noSeats = response.data[i].noSeats
          entry.flightNum = response.data[i].flightNum
          entry.depTime = response.data[i].depTime
          entry.arrTime = response.data[i].arrTime
          entry.terminal = response.data[i].terminal

          array.push(entry);         
        }

        this.data = array
      })
      .catch(function (error) {
        console.log(error);
      });

 }
// This method will get the data from the database.
This method will get the data from the database.
This method will get the data from the database .
componentDidMount() {
    this.setState({isRendered: false});
      axios
      .get("http://localhost:5000/record/")
      .then((response) => {
        this.setState({ records: response.data });
        for(var i in response.data){         
          let entry = {};
          entry.flight_from = response.data[i].flight_from
          entry.flight_to = response.data[i].flight_to
          entry.flight_date = response.data[i].flight_date
          entry.cabin = response.data[i].cabin
          entry.noSeats = response.data[i].noSeats
          entry.flightNum = response.data[i].flightNum
          entry.depTime = response.data[i].depTime
          entry.arrTime = response.data[i].arrTime
          entry.terminal = response.data[i].terminal
          array.push(entry);         
        }
        this.data = array
      })
      .catch(function (error) {
        console.log(error);
      });
 }
componentDidMount ( ) { this . setState ( { isRendered : false } ) ; axios . get ( "http://localhost:5000/record/" ) . then ( ( response ) => { this . setState ( { records : response . data } ) ; for ( var i in response . data ) { let entry = { } ; entry . flight_from = response . data [ i ] . flight_from entry . flight_to = response . data [ i ] . flight_to entry . flight_date = response . data [ i ] . flight_date entry . cabin = response . data [ i ] . cabin entry . noSeats = response . data [ i ] . noSeats entry . flightNum = response . data [ i ] . flightNum entry . depTime = response . data [ i ] . depTime entry . arrTime = response . data [ i ] . arrTime entry . terminal = response . data [ i ] . terminal array . push ( entry ) ; } this . data = array } ) . catch ( function ( error ) { console . log ( error ) ; } ) ; }
This method will get the data from the database.
This method will get the data from the database .