As a User I should be able to edit the details about my plants
AC
WHEN the page loads
THEN I should see a button to edit on each plant card
AND it should open a modal for editing the details of the plant
Dev Notes
[x] Inside plantsData.js create a function called putPlant that takes in the plantId and the updatedPlant, and uses the axios.put method to update the plant in the Firebase collection
[x] On each plantCard there should be a button that opens a prepopulated modal for editing the plant
[x] This form should look just like the one for a NewPlant but all the fields should already be prepopulated
[x] In the EditPlantModal.js file there should be onChange functions for all of the input fields
[x] Also in this file there should be a updatePlant function that fires on submission of the form that takes in all the state variables and assignes them to the correct keys for an updatedPlant object
[x] The function should then call the putPlant function previously defined and take in the plantId and the updatedPlant, which should then update the collection in Firebase
User Story
AC
WHEN the page loads THEN I should see a button to edit on each plant card AND it should open a modal for editing the details of the plant
Dev Notes
[x] Inside plantsData.js create a function called
putPlant
that takes in the plantId and the updatedPlant, and uses theaxios.put
method to update the plant in the Firebase collection[x] On each
plantCard
there should be a button that opens a prepopulated modal for editing the plant[x] This form should look just like the one for a NewPlant but all the fields should already be prepopulated
[x] In the EditPlantModal.js file there should be onChange functions for all of the input fields
[x] Also in this file there should be a
updatePlant
function that fires on submission of the form that takes in all the state variables and assignes them to the correct keys for anupdatedPlant
object[x] The function should then call the
putPlant
function previously defined and take in the plantId and the updatedPlant, which should then update the collection in Firebase[x] The modal should close on submission