navigation after adding recipes

This commit is contained in:
fred 2025-07-08 11:13:01 -07:00
parent cd234531b9
commit e74f247415
3 changed files with 21 additions and 10 deletions

View file

@ -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)