As a user I should be able to add a planetary sector
AC
WHEN a user is logged in
THEN there should be a button at the top of the planetary sectors section
AND the user should be able to add a planetary sector
Dev Notes
[x] add a <div> with id="add-new-planetary-sector-modal" to the top of the page, under the nav, but above everything else
[x] add a button under the Planetary Sectors title in buildAllPlanetarySectors with id="add-new-planetary-sector-btn"
[x] use a font awesome plus icon and add-new-planetary-sector
[x] add an event listener to the new button
[x] the event listener should call a function called newPlanetarySectorForm
[x] create a new component folder/file called newPlanetarySectorForm
[x] create a function in newPlanetarySectorForm called newPlanetarySectorForm
[x] build out an html bootstrap form using the domString variable
[x] it should have as many inputs as keys in the object, title appropriately
[x] it should have a submit button at the bottom
[x] the submit button has an event listener attached that calls a function named saveNewPlanetarySectorItem
[x] in planetarySectors.js create the function saveNewPlanetarySectorItem
[x] create addPlanetarySector function in planetarySectorsData.js
[x] uses an axios.post() to send to database
[x] back in saveNewPlanetarySectorItem function takes e as a parameter
[x] use e.preventDefault()
[x] then call addPlanetarySector function
[x] .catch() should console.error and comment and the error
[x] .then() should create an object called newPlanetarySectorItem with as many key:value pairs as there are keys in the original seed data, plus the uid key that calls the getMyUid function
[x] should then call the buildAllPlanetarySectors function
User Story
As a user I should be able to add a planetary sector
AC
WHEN a user is logged in THEN there should be a button at the top of the planetary sectors section AND the user should be able to add a planetary sector
Dev Notes
<div>
withid="add-new-planetary-sector-modal"
to the top of the page, under the nav, but above everything elsePlanetary Sectors
title inbuildAllPlanetarySectors
withid="add-new-planetary-sector-btn"
add-new-planetary-sector
newPlanetarySectorForm
newPlanetarySectorForm
newPlanetarySectorForm
callednewPlanetarySectorForm
domString
variablesaveNewPlanetarySectorItem
planetarySectors.js
create the functionsaveNewPlanetarySectorItem
addPlanetarySector
function inplanetarySectorsData.js
axios.post()
to send to databasesaveNewPlanetarySectorItem
function takese
as a parametere.preventDefault()
addPlanetarySector
function.catch()
should console.error and comment and the error.then()
should create an object callednewPlanetarySectorItem
with as manykey:value
pairs as there are keys in the original seed data, plus the uid key that calls thegetMyUid
functionbuildAllPlanetarySectors
function