nss-evening-cohort-10 / nutshell-star-destroyer

0 stars 1 forks source link

Planetary System: Delete #80

Open ConnorSullivan10 opened 4 years ago

ConnorSullivan10 commented 4 years ago

User Story

As a user, I should be able to delete a Planetary System.

AC

GIVEN the user is logged in and visits the Planetary Systems page WHEN a user clicks the "X" button in the top right of a planetary system card THEN that planetary system's info should be removed from the Firebase database, and the planetary systems should be reprinted on the page

Dev Notes

const deleteFood = (id) => axios.delete(`${baseUrl}/foods/${id}.json`);
const deleteSystem = (e) => {
  e.preventDefault();
  systemData.deleteSystem(e.target.id)
    .then(() => {
    // eslint-disable-next-line no-use-before-define
      createSystemCards();
    })
    .catch((error) => console.error(error));
};