Skip to content

Commit

Permalink
made basic flightForm edits
Browse files Browse the repository at this point in the history
  • Loading branch information
Logan Leopold committed Jun 17, 2021
1 parent 3ab3f3e commit 1b56d91
Showing 1 changed file with 8 additions and 28 deletions.
36 changes: 8 additions & 28 deletions src/FlightForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class FlightForm extends Component {
locale: "en-US",
livePrice: "",
status: "",
// oAuth: '',
};

this.componentDidMount = this.componentDidMount.bind(this);
Expand Down Expand Up @@ -60,40 +59,22 @@ class FlightForm extends Component {
outboundDate: today
})

// // 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

// axios({
// method: 'post',
// url: 'https://test.api.amadeus.com/v1/security/oauth2/token',
// headers: {
// "Content-Type":"application/x-www-form-urlencoded",
// },
// data: body
// }).then( function(response) {
// let token = response.data.access_token
// form.setState({
// oAuth: token
// })
// }).catch( err => console.log(err))

}

// Find Routes Button
handleFindRoutes(event) {

event.preventDefault()

var params = {
OutboundDate: "Departure Date",
InboundDate: "Return Date",
OriginPlace: "Departure Airport Code",
DestinationPlace: "Arrival Airport Code",
}
// var params = {
// OutboundDate: "Departure Date",
// InboundDate: "Return Date",
// OriginPlace: "Departure Airport Code",
// DestinationPlace: "Arrival Airport Code",
// }

document.querySelectorAll('.formSubmit')[0].style.display = "none"

var priceDisplay = document.querySelectorAll('.formSubmit')[0]
priceDisplay.style.display = "none"
var alert = document.querySelectorAll('.formStatus')[0];

if (Date.parse(this.state.inboundDate) < Date.parse(this.state.outboundDate)) {
Expand All @@ -117,7 +98,6 @@ class FlightForm extends Component {
}
})
.then( function(response) {
var priceDisplay = document.querySelectorAll('.formSubmit')[0];
if (response.data.Quotes.length === 0) {
alert.innerHTML = "There are no results on this itinerary. Try pushing out your outbound date a bit further."
alert.style.display = "flex"
Expand Down

0 comments on commit 1b56d91

Please sign in to comment.