nss-evening-cohort-11 / nutshell-droids-ewoks

PanAm Airline
0 stars 1 forks source link

Remove crew members from a flight. #88

Open Nikababy01 opened 4 years ago

Nikababy01 commented 4 years ago

User Story

As a user, I should be able to remove crew members from a flight.

AC

WHEN looking at the flights "page"

THEN I should see all the flights

Dev Notes

In src/javascripts/helpers/data create a smashData.js file to add the data to the planned flights const getAllFlightInfo = ( ) => new Promise (resolve, reject) => { planesData.js.getPlanes( ) .then((planesResponse) =>{ hubData.getAllAirports( ).then((hubResponse) => { crewData.js.getAllCrews( ).then((crewResponse) => { foodData.js.getAllFoods( ) . then ((foodResponse)= { resolve([]);

  1. `go to the cards for the flights and add a domString for a form

  2. crew.forEach((crew) => { domString += '

    '; domString += <input type="checkbox" class="form-check-input- crew-checkbox" d i ${crew.isChecked ? 'checked' : ''}>; domString += <label class="form-check-label" for="exampleCheck1">${crew.name}</label>; domString += '
    ';

  3. add event listener ('body').on(;click', '.crew-checkbox', flightController)

  4. create a event flightController make an axios call in the data file: deleteFlightCrew =(flightCrewId) => axios.delete($(${baseUrl}/flights/${flightCrewId}.json`);