As a user, I should be able to delete mission weapons from a mission I created
AC
WHEN I see a single mission
THEN there should be a way to delete the weapon from the mission
THEN the mission weapon data should be removed from the database
AND the page should update and reflect those changes
DEV NOTES
[ ] edit the singleMissionWeaponCard function to include a delete button
[ ] give it an id using a template literal id="${weapon.weaponMissionId}"
[ ] attach an event listener to the buttons in singleViewMissionWeaponl
[ ] event listener should call a function that lives in singleViewMissionWeapon file.
USER STORY
As a user, I should be able to delete mission weapons from a mission I created
AC
WHEN I see a single mission THEN there should be a way to delete the weapon from the mission THEN the mission weapon data should be removed from the database AND the page should update and reflect those changes
DEV NOTES
singleMissionWeaponCard
function to include a delete buttonid="${weapon.weaponMissionId}"
singleViewMissionWeaponl
singleViewMissionWeapon
file.removeWeaponFromMission
removeWeaponFromMission
callsdeleteWeaponFromMission
.then()
and.catch()
.catch()
as usual withconsole.error()
.then()
reprints single view or kicks you out to full mission viewdeleteWeaponFromMission
function inmissionWeapons.js
fileaxios.delete()
method to remove the entry from the database