navigation after adding recipes
This commit is contained in:
parent
cd234531b9
commit
e74f247415
3 changed files with 21 additions and 10 deletions
|
@ -10,11 +10,11 @@ export const getRecipeById = async (id) => {
|
|||
return data;
|
||||
};
|
||||
|
||||
export const addRecipe = async (name, cuisine) => {
|
||||
export const addRecipe = async (recipeData) => {
|
||||
const response = await fetch("http://localhost:6063/add-recipe", {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ name, cuisine })
|
||||
body: JSON.stringify(recipeData)
|
||||
});
|
||||
const data = await response.json();
|
||||
console.log(data)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue