As a user, I should be able to click on the Edit button of a specific enemy and modify any trait value associated with that enemy.
AC
WHEN I click the Edit button on an enemy card
THEN a modal will open to modify any given trait value of the enemy
AND the user can click the Save Changes button, the modal disappears from the page
THEN Firebase will be updated with the modify enemy information
THEN the modified changes will show on the enemy card on the page
Dev Notes
Create ra-enemy-Update branch
Create axios.put() in enemiesData.js file
STEP 1 Of UpdateCreate updateAEnemy event listener on the edit button in enemies.jswith the (enemy.id) this will be how I capture
the enemy object from firebase then be able to make the wanted edits to the enemy, the selected enemy object info will pre-populate in modal on this event.
STEP 2 Of UpdateCreate edit enemy function in enemies.js file this function will build up the updated enemy object to send back to firebase
*Create event listener on the Save Changes button in enemies.js file this will call the edit enemy function that will update firebase and then the page reflects this change this edit
when enemiesBuilder function is called
EDIT functionality doesn't work. Modal needs to prepopulate with key value pairs of the object clicked, and firebase data should be edited then reprinted after clicking the "Save" button in the modal.
User Story
As a user, I should be able to click on the
Edit
button of a specific enemy and modify any trait value associated with that enemy.AC
WHEN I click the
Edit
button on an enemy card THEN a modal will open to modify any given trait value of the enemy AND the user can click theSave Changes
button, the modal disappears from the page THEN Firebase will be updated with the modify enemy information THEN the modified changes will show on the enemy card on the pageDev Notes
ra-enemy-Update
branchenemiesData.js
file STEP 1 Of Update CreateupdateAEnemy
event listener on the edit button inenemies.js
with the (enemy.id) this will be how I capture the enemy object from firebase then be able to make the wanted edits to the enemy, the selected enemy object info will pre-populate in modal on this event. STEP 2 Of Update Create edit enemy function inenemies.js
file this function will build up the updated enemy object to send back to firebase *Create event listener on theSave Changes
button inenemies.js
file this will call the edit enemy function that will update firebase and then the page reflects this change this edit whenenemiesBuilder
function is called