As a User I should be able to edit the details about my Rooms
AC
WHEN the page loads
THEN I should see a button to edit on each room card
AND it should open a modal for editing the details of the room
Dev Notes
[x] Inside roomsData.js create a function called putRoom that takes in the roomId and the updatedRoom, and uses the axios.put method to update the room in the Firebase collection
[x] On each roomCard 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 NewRoom but all the fields should already be prepopulated
[x] In the EditRoomModal.js file there should be onChange functions for all of the input fields
[x] Also in this file there should be a updateRoom function that fires on submission of the form that takes in all the state variables and assigns them to the correct keys for an updatedRoom object
[x] The function should then call the putRoom function previously defined and take in the roomId and the updatedRoom, 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 room card AND it should open a modal for editing the details of the room
Dev Notes
[x] Inside roomsData.js create a function called
putRoom
that takes in the roomId and the updatedRoom, and uses theaxios.put
method to update the room in the Firebase collection[x] On each
roomCard
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 NewRoom but all the fields should already be prepopulated
[x] In the EditRoomModal.js file there should be onChange functions for all of the input fields
[x] Also in this file there should be a
updateRoom
function that fires on submission of the form that takes in all the state variables and assigns them to the correct keys for anupdatedRoom
object[x] The function should then call the
putRoom
function previously defined and take in the roomId and the updatedRoom, which should then update the collection in Firebase[x] The modal should close on submission