Skip to content

Commit

Permalink
cleaned a couple console.logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Logan Leopold committed Mar 4, 2021
1 parent a1fe71a commit 76cb439
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 32 deletions.
3 changes: 1 addition & 2 deletions src/AirportInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,13 @@ class AirportInput extends Component {
thisCom.setState({
airport: response.data.data[0]
}, () => {
console.log(thisCom.state.airport.name)
thisCom.props.handleAirportChange(thisCom.props.name, thisCom.state.airport)
if (thisCom.props.name === "originPlace" && thisInput.dataset.country !== thisCom.props.country) {
thisCom.props.handleAirportChange("country", thisInput.dataset.country)
}
});

console.log(response.data.data);
// console.log(response.data.data);

while (thisInput.nextSibling) {
thisInput.parentNode.removeChild(thisInput.nextSibling);
Expand Down
26 changes: 3 additions & 23 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import React, { Component } from "react";
import {Route, Link} from "react-router-dom"
import "./App.css";
import FlightForm from "./FlightForm";
import Login from "./Login"
import CreateUser from "./CreateUser";
import axios from "axios";
// import Login from "./Login"
// import CreateUser from "./CreateUser";
// import axios from "axios";


class App extends Component {
Expand All @@ -14,23 +14,8 @@ class App extends Component {
airports: [],
markets: []
};
// this.componentDidMount = this.componentDidMount.bind(this)
}

// componentDidMount() {

// // axios.get('https://tickettrackr.herokuapp.com/api/countries/db/search')
// // .then( (res) => {
// // this.setState({
// // markets: res.data,
// // })
// // })
// // .catch(function(response) {
// // console.log(response);
// // })

// }

render() {
console.log("App rendered boi");
return (
Expand All @@ -45,14 +30,9 @@ class App extends Component {
<div className='update'>
<p >Public access to the main 3rd-party API used for this app was recently restricted. Redevelopment with a new partner is under way. Please refer to the github for the <span><a href="https://github.com/LoganLeopold/Ticket_Trackr_FrontEnd">front end</a></span> and <a href="https://github.com/LoganLeopold/Ticket_Trackr_BackEnd">back end</a> in the meantime. -Logan <span className="today"></span></p>
</div>
{/* <Link to='/login'><div class="navLinks">Login</div></Link>
<Link to='/new-user'><div class="navLinks">Create Account</div></Link> */}
</header>
{/* <FlightForm {...this.props}{...this.state}/> */}
<div>
<Route path="/" exact render={ (routerProps) => <FlightForm {...routerProps}{...this.props}{...this.state}/> }></Route>
{/* <Route path="/login" exact render={(routerProps) => <Login {...routerProps}{...this.state} />}></Route>
<Route path="/new-user" exact render={(routerProps) => <CreateUser {...routerProps}{...this.state} />}></Route> */}
</div>
</div>
);
Expand Down
9 changes: 2 additions & 7 deletions src/FlightForm.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import React, { Component } from "react";
import axios from "axios";
import { Row, Container, Col } from "reactstrap";
import CountrySelect from "./countrySelect"
import DateP from "./Date";
import AirportInput from "./AirportInput"
// var Amadeus = require("amadeus")
var moment = require("moment");

class FlightForm extends Component {
Expand Down Expand Up @@ -62,7 +60,7 @@ class FlightForm extends Component {
outboundDate: today
})

// Begin API Access
// Begin API Access - Retrieving Token
let body = `grant_type=client_credentials&client_id=${process.env.REACT_APP_AMADEUS_KEY}&client_secret=${process.env.REACT_APP_AMADEUS_SECRET}`;
let form = this

Expand Down Expand Up @@ -115,7 +113,7 @@ class FlightForm extends Component {
"useQueryString": true,
},
params: {
inboundpartialdate: moment(this.state.inboundDate).format("YYYY-MM-DD")
// inboundpartialdate: moment(this.state.inboundDate).format("YYYY-MM-DD")
}
})
.then( function(response) {
Expand All @@ -137,9 +135,6 @@ class FlightForm extends Component {
})
.catch(function(err) {
console.log(err.response)
// err.response.data.ValidationErrors.forEach(error => alert.innerHTML = params[error.ParameterName] + ': ' + error.Message + ". <br />");
// alert.innerHTML += "Adjust these errors and try again."
// alert.style.display = "flex";
})
} else {
/*
Expand Down

0 comments on commit 76cb439

Please sign in to comment.