as a user I should be able to delete a planetary sector
AC
WHEN a user is logged in
THEN they should be able to see a delete button on all planetary sector cards
AND they should be able to delete a planetary sector from the database/remove it from the page
Dev Notes
[x] in planetarySectors.js create a new function called deletePlanetarySector
[x] make an axios.delete() request
[x] add an id to all of the planetary sector cards in buildPlanetarySectorCards using a template literal and planetarySector.id
[x] add a delete button to each card using the buildPlanetarySectorCards function, use font awesome trash can icon, add class="planetary-sector-delete-button"
[x] add an event listener to the delete button using jquery .on() method
[x] in buildAllPlanetarySectors create a new function called removePlanetarySectorCard
[x] takes a single argument of e
[x] declare a variable called planetarySectorId
[x] value is e.target.closest...
[x] call the delete function from planetarySectorsData
[x] use .then() to call buildAllPlanetarySectors
[x] then use .catch() to console.error a comment and the error
User Story
as a user I should be able to delete a planetary sector
AC
WHEN a user is logged in THEN they should be able to see a delete button on all planetary sector cards AND they should be able to delete a planetary sector from the database/remove it from the page
Dev Notes
planetarySectors.js
create a new function calleddeletePlanetarySector
axios.delete()
requestbuildPlanetarySectorCards
using a template literal andplanetarySector.id
buildPlanetarySectorCards
function, use font awesome trash can icon, addclass="planetary-sector-delete-button"
.on()
methodbuildAllPlanetarySectors
create a new function calledremovePlanetarySectorCard
e
planetarySectorId
e.target.closest...
planetarySectorsData
.then()
to callbuildAllPlanetarySectors
.catch()
to console.error a comment and the error