componentDidMount() {
    axios
      .get("http://localhost:5000/record/" + this.props.match.params.id)
      .then((response) => {
        this.setState({
          flight_from: response.data.flight_from,
          flight_to: response.data.flight_to ,
          flightNum: response.data.flightNum,
          flight_date:response.data.flight_date ,
          cabin:response.data.cabin ,
          noSeats: response.data.noSeats,
          depTime: response.data.depTime,
          arrTime: response.data.arrTime,
          terminal: response.data.terminal,
        });
      })
      .catch(function (error) {
        console.log(error);
      });
  }
// This will get the record based on the id from the database.
This will get the record based on the id from the database.
This will get the record based on the id from the database .
componentDidMount() {
    axios
      .get("http://localhost:5000/record/" + this.props.match.params.id)
      .then((response) => {
        this.setState({
          flight_from: response.data.flight_from,
          flight_to: response.data.flight_to ,
          flightNum: response.data.flightNum,
          flight_date:response.data.flight_date ,
          cabin:response.data.cabin ,
          noSeats: response.data.noSeats,
          depTime: response.data.depTime,
          arrTime: response.data.arrTime,
          terminal: response.data.terminal,
        });
      })
      .catch(function (error) {
        console.log(error);
      });
  }
componentDidMount ( ) { axios . get ( "http://localhost:5000/record/" + this . props . match . params . id ) . then ( ( response ) => { this . setState ( { flight_from : response . data . flight_from , flight_to : response . data . flight_to , flightNum : response . data . flightNum , flight_date : response . data . flight_date , cabin : response . data . cabin , noSeats : response . data . noSeats , depTime : response . data . depTime , arrTime : response . data . arrTime , terminal : response . data . terminal , } ) ; } ) . catch ( function ( error ) { console . log ( error ) ; } ) ; }
This will get the record based on the id from the database.
This will get the record based on the id from the database .