diff --git a/frontend/src/pages/AddRecipe.tsx b/frontend/src/pages/AddRecipe.tsx index ecff456..95f6b47 100644 --- a/frontend/src/pages/AddRecipe.tsx +++ b/frontend/src/pages/AddRecipe.tsx @@ -190,9 +190,13 @@ const AddRecipe: React.FC = () => { } const cancelNumOfPeopleDialog = async () => { - const recipeId = await handleSaveRecipe(); - if (!recipeId) return false; - setOpenNumOfPeapleDialog(false); + // const allRecipes = await recipeApi.getAllRecipes(); + // const allRecipesId = allRecipes.map(recipe => recipe.recipeId); + // const allStocks = await stockApi.getStocks(); + // const allStuffIdAndAmount = [allStocks.map(stock => stock.stuffId), allStocks.map(stock => stock.amount)]; + // Promise.all(allRecipesId.map(async recipe => { + // (await recipeApi.getById(recipe) + // })) } // コンポーネントマウント時にタスク一覧を取得 diff --git a/frontend/src/pages/RecipeList.tsx b/frontend/src/pages/RecipeList.tsx index bcdce5a..08ec897 100644 --- a/frontend/src/pages/RecipeList.tsx +++ b/frontend/src/pages/RecipeList.tsx @@ -28,7 +28,7 @@ import { } from '@mui/material'; import { Add as AddIcon, Delete as DeleteIcon, ShoppingBasket as ShoppingBasketIcon, - SoupKitchen as SoupKitchenIcon + SoupKitchen as SoupKitchenIcon, Close as CloseIcon, TaskAlt as TaskAltIcon } from '@mui/icons-material'; import { ToBuy, Stuff, RecipeWithId, RecipeDetail } from '../types/types'; import { useMessage } from '../components/MessageContext'; @@ -50,6 +50,8 @@ const RecipeList: React.FC = () => { try { const recipes = await recipeApi.getAllRecipes(); setAllRecipes(recipes); + console.log("マックス"); + console.log(recipes.map(recipe => recipe.maxServings)) } catch (error) { showErrorMessage("レシピの取得に失敗しました。"); // console.error(`${TASK_ERRORS.FETCH_FAILED}:`, error); @@ -90,6 +92,7 @@ const RecipeList: React.FC = () => { onClick={() => openRecipeById(recipe.recipeId)} > {recipe.recipeName} + {recipe.maxServings === 0 && } //