Closed williaj615 closed 4 years ago
Add works only when you click "Save New Enemy" button in modal. "Save Changes" button doesn't work and should be removed. Modal should display with empty inputs when you click "Add New Enemy", but currently the modal will show whatever text you entered into the input form last. "Add New Enemy" button should only display when the user is logged in.
User Story
As a logged in user, I should be able to create new enemy when I click on the
add enemy
button on the top of the page.AC
WHEN a logged in user clicks on the
add enemy
button at the top of the page THEN a modal will present to the page with the input fields corresponding to the labels to type in the enemy values THEN the user will click theSave New Enemy
button and the modal leaves the page THEN the new enemy is added to the firebase and the new enemy card appears in theenemiespage
div on the pageDev Notes
ra-enemy-CREATE
branch *Confirm theaxios.post
is working with aconsole.log
in theenemies.js
.then
Add New Enemy
button is only visible to logged in users.allModalsDiv
.Add New Enemy
button that the modal displays in theallModalsDiv
div for the user to input the values of the new enemyenemies.js
:$('#savenewenemy').click(addNewEnemy)
runs theAddNewEnemy
function and the new enemy is added to firebasebuildEnemies
is called to reflect the new enemy is on the page with the already existing ones.