Open Nikababy01 opened 4 years ago
As a user, I should be able to view a single flight
WHEN looking at the flights "page"
THEN I should see all the flights
create a div in index.html with an id of single-flight, class of hide
single-flight
update authData.checkLoginStatus and add removeClass into the if statement for single-flight
authData.checkLoginStatus
add a flightsData.js in the helpers/data
const getFlights = () => new Promise((resolve, reject) => { axios.get(${baseUrl}/flights.json) `
const getFlights = () => new Promise((resolve, reject) => { axios.get(
)
'export getFlights`
'In javascript/src/components add a single=flight component const buildSingleFlight = (e) => { const planeId = e.target.closest('.card').id; flightsData.getSingleFlight
' build domString to view the flight information using a bootstrap card'
singleFlight.flights.forEach((flight) => { domString += <p class="card-text">${flight.plane.id} ${flight.arrival_airportId} ${flight.departure_airportId} ${flight.departure_time} ${flight.arrival_time}${flight.arrival_city} ${flight.departure_city} </p>;
<p class="card-text">${flight.plane.id} ${flight.arrival_airportId} ${flight.departure_airportId} ${flight.departure_time} ${flight.arrival_time}${flight.arrival_city} ${flight.departure_city} </p>
`
User Story
As a user, I should be able to view a single flight
AC
WHEN looking at the flights "page"
THEN I should see all the flights
Dev Notes
create a div in index.html with an id of
single-flight
, class of hideupdate
authData.checkLoginStatus
and add removeClass into the if statement forsingle-flight
add a flightsData.js in the helpers/data
const getFlights = () => new Promise((resolve, reject) => { axios.get(
${baseUrl}/flights.json)
`'export getFlights`
'In javascript/src/components add a single=flight component const buildSingleFlight = (e) => { const planeId = e.target.closest('.card').id; flightsData.getSingleFlight
' build domString to view the flight information using a bootstrap card'
singleFlight.flights.forEach((flight) => { domString +=
<p class="card-text">${flight.plane.id} ${flight.arrival_airportId} ${flight.departure_airportId} ${flight.departure_time} ${flight.arrival_time}${flight.arrival_city} ${flight.departure_city} </p>
;`