onSubmit(e) {
    e.preventDefault();
    const newEditedflight = {
      flight_from: this.state.flight_from,
      flight_to: this.state.flight_to,
      flightNum: this.state.flightNum,
      flight_date: this.state.flight_date,
      cabin: this.state.cabin,
      noSeats: this.state.noSeats,
      depTime: this.state.depTime,
      arrTime: this.state.arrTime,
      terminal: this.state.terminal,
    };
    console.log(newEditedflight);


    // This will send a post request to update the data in the database.
    axios
      .post(
        "http://localhost:5000/update/" + this.props.match.params.id,
        newEditedflight
      )
      .then((res) => console.log(res.data));

    this.props.history.push("/");
    alert('Your Flight Has Been Updated.');
    window.location.reload();
  }
// This function will handle the submission.
This function will handle the submission.
This function will handle the submission .
onSubmit(e) {
    e.preventDefault();
    const newEditedflight = {
      flight_from: this.state.flight_from,
      flight_to: this.state.flight_to,
      flightNum: this.state.flightNum,
      flight_date: this.state.flight_date,
      cabin: this.state.cabin,
      noSeats: this.state.noSeats,
      depTime: this.state.depTime,
      arrTime: this.state.arrTime,
      terminal: this.state.terminal,
    };
    console.log(newEditedflight);
    axios
      .post(
        "http://localhost:5000/update/" + this.props.match.params.id,
        newEditedflight
      )
      .then((res) => console.log(res.data));
    this.props.history.push("/");
    alert('Your Flight Has Been Updated.');
    window.location.reload();
  }
onSubmit ( e ) { e . preventDefault ( ) ; const newEditedflight = { flight_from : this . state . flight_from , flight_to : this . state . flight_to , flightNum : this . state . flightNum , flight_date : this . state . flight_date , cabin : this . state . cabin , noSeats : this . state . noSeats , depTime : this . state . depTime , arrTime : this . state . arrTime , terminal : this . state . terminal , } ; console . log ( newEditedflight ) ; axios . post ( "http://localhost:5000/update/" + this . props . match . params . id , newEditedflight ) . then ( ( res ) => console . log ( res . data ) ) ; this . props . history . push ( "/" ) ; alert ( 'Your Flight Has Been Updated.' ) ; window . location . reload ( ) ; }
This function will handle the submission.
This function will handle the submission .
// This will send a post request to update the data in the database.