We have created the "Create Recipe" modal, let's make this component dynamic so it works for editing a recipe as well!
[ ] Update the EditRecipe modal component to now accept a recipe prop (if the modals state is named recipe already - maybe name this prop recipeToEdit or something similar)
[ ] This prop will be optional. BUT if it is provided - make it the default value for state
[ ] Update every input to be controlled
[ ] At this point you should be able to ensure that by providing a recipe object to the editRecipe modal component, the form restores or pre-fills all the items provided!
[ ] Editing a field should update the local state (not the prop)
[ ] Update the save function - if the recipe state has an id call the PUT v1/recipe/:id endpoint. Otherwise, continue to call the post.
[ ] Update the title - if the recipe state has an id say Edit Recipe otherwise continue saying Create Recipe
This card is blocked by #18
We have created the "Create Recipe" modal, let's make this component dynamic so it works for editing a recipe as well!
recipe
prop (if the modals state is named recipe already - maybe name this prop recipeToEdit or something similar)recipe
state has an id call the PUTv1/recipe/:id
endpoint. Otherwise, continue to call the post.recipe
state has an id sayEdit Recipe
otherwise continue sayingCreate Recipe