ZacCrumpton / front-end-capstone

0 stars 0 forks source link

New Anime Form #10

Open ZacCrumpton opened 4 years ago

ZacCrumpton commented 4 years ago

USER STORY

as a user, after click the new anime button i should see a form appear that allows me to add information and save it to my database

AC

WHEN after the new list, or add list button has been clicked THEN i should see a form appear AND i should be able to add information to the form AND the information will be added to a database AND the new card list item will appear after the save button has been clicked

DEV NOTES

  1. create a new component named NewAnimeForm in the pages folder
    • will need a js and a scss file.
  2. grab a basic form structure from bootstrap
    • make sure <input> has type, className, id, value and onChange fields.
  3. set state for input fields
  4. add a function for all onChange functions needed (see ticket #5 for an example of this function)
  5. make a save function that will save the fields that have been added (example provided in ticket #5 or look at scatt-surprise or react-hoarder if need be)
  6. add a save button to the bottom of the form and call the save function with an onClick
  7. this form should also add a listId once saved
  8. in animeData inside this directory ../helpers/data/animeData we will add a post function to add the new list to firebase
    • here's an example: const postItem = (newItem) => axios.post(`${baseUrl}/items/item.json`, newItem);
  9. we will also need a getSingleList function for this form. this should be in the animeData located in this directory ../helpers/data/animeData
    • example below in comments
ZacCrumpton commented 4 years ago

getSingleList function example:

const getSingleItem = (itemId) => axios.get(`${baseUrl}/${itemId}.json`);