WHEN a user is logged in
THEN there should be a button at the top of the personnel section
AND the user should be able to add personnel
Dev Notes
[x] add a <div> with id="add-new-personnel-modal" to the top of the page, under the nav, but above everything else
[x] add a button under the personnel title in buildAllPersonnel with id="add-new-personnel-btn"
[x] use a font awesome plus icon and add-new-personnel
[x] add an event listener to the new button
[x] the event listener should call a function called newPersonnelForm
[x] create a new component folder/file called newPersonnelForm
[x] create a function in newPersonnelForm called newPersonnelForm
[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 attacked that calls a function named saveNewPersonnelItem
[x] in personnel.js create the function saveNewPersonnelItem
[x] create addPersonnel function in personnelData.js
[x] uses an axios.post() to send to database
[x] back in saveNewPersonnelItem function takes e as a parameter
[x] use e.preventDefault()
[x] then call addPersonnel function
[x] .catch() should console.error and comment and the error
[x] .then() should create an object called newPersonnelItem 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] shoudl then call the buildAllPersonnel function
User Story
As a user I should be able to add Personnel
AC
WHEN a user is logged in THEN there should be a button at the top of the personnel section AND the user should be able to add personnel
Dev Notes
<div>
withid="add-new-personnel-modal"
to the top of the page, under the nav, but above everything elsepersonnel
title inbuildAllPersonnel
withid="add-new-personnel-btn"
add-new-personnel
newPersonnelForm
newPersonnelForm
newPersonnelForm
callednewPersonnelForm
domString
variablesaveNewPersonnelItem
personnel.js
create the functionsaveNewPersonnelItem
addPersonnel
function inpersonnelData.js
axios.post()
to send to databasesaveNewPersonnelItem
function takese
as a parametere.preventDefault()
addPersonnel
function.catch()
should console.error and comment and the error.then()
should create an object callednewPersonnelItem
with as manykey:value
pairs as there are keys in the original seed data, plus the uid key that calls thegetMyUid
functionbuildAllPersonnel
function