nss-evening-cohort-10 / nutshell-renaissance-fair

0 stars 0 forks source link

Add Event Show #78

Open jbkey2015 opened 4 years ago

jbkey2015 commented 4 years ago

User Story

As a user, I should be able to a add Show to an Event.

AC

WHEN the user goes to an events page AND the user clicks the ADDEVENTSHOW button THEN a modal should appear with check boxes that upon checking a box will add a show.

Dev Notes

Show -> showEvent: Smash

  1. Get all Shows
  2. Get all showEvents
  3. const showEventSmash = []; shows.forEach((show) => {
  4. If (show.EventId === eventId) { show.push("isChecked": true } else { "isChecked": false }
  5. resolve(showEventSmash)

Place in showEvents Component

const printshowOpt = () => {
    let domString = '';
    forEach(show){
    domString +=`
    <div class="form-check">
        <input class="form-check-input show" type="checkbox" name="${shows.id}" id="${shows.id}" value="${show.name}" ${(show.isChecked === true) ? checked : unchecked}>
        <label class="form-check-label" for="${show.id}">${show.name}</label>
    </div>
  `;
    }
    utilities.printToDom('showsSelection', domString);
};

Modify Show Event

modifyShowEvent = (showId) => {
  if (checked) {
    showEventData.addShowEvent(showId)
  };
};

Add Axios call const addShowEvent = (showId) => axios.post(${baseUrl}/showEvents.json, showId);

zoeames commented 4 years ago

check the erd for eventShows it should only have 2 things in it eventId and showId