As a user, I should be able to delete a planetary system from a mission I created
AC
WHEN I see a single mission
THEN there should be a way to delete a planetary system from the mission
THEN the planetary system data should be removed from the database
AND the page should update and reflect those changes
DEV NOTES
[ ] edit the singleMissionPlanetarySystemCard function to include a delete button
[ ] give it an id using a template literal id="${planetarySystem.planetarySystemMissionId}"
[ ] attach an event listener to the buttons in singleViewMissionPlanetarySystem
[ ] event listener should call a function that lives in singleViewMissionPlanetarySystem file.
[ ] function is called removePlanetarySystemFromMission
USER STORY
As a user, I should be able to delete a planetary system from a mission I created
AC
WHEN I see a single mission THEN there should be a way to delete a planetary system from the mission THEN the planetary system data should be removed from the database AND the page should update and reflect those changes
DEV NOTES
singleMissionPlanetarySystemCard
function to include a delete buttonid="${planetarySystem.planetarySystemMissionId}"
singleViewMissionPlanetarySystem
singleViewMissionPlanetarySystem
file.removePlanetarySystemFromMission
removePlanetarySystemFromMission
callsdeletePlanetarySystemFromMission
.then()
and.catch()
.catch()
as usual withconsole.error()
.then()
reprints single view or kicks you out to full mission viewdeletePlanetarySystemFromMission
function inmissionPlanetarySystem.js
fileaxios.delete()
method to remove the entry from the database