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