diff --git a/frontend/src/pages/StockPage.tsx b/frontend/src/pages/StockPage.tsx index 899bce1..a555b84 100644 --- a/frontend/src/pages/StockPage.tsx +++ b/frontend/src/pages/StockPage.tsx @@ -106,8 +106,14 @@ const StockPage: React.FC = () => { if (newStock.newAddition) { newStock.stuffId = null; } - if (isNaN(newStock.amount)) return; - if (isNaN(newStock.price)) return; + if (isNaN(newStock.amount)) { + showErrorMessage(GENERAL_ERRORS.INVALID_AMOUNT); + return; + } + if (isNaN(newStock.price)) { + showErrorMessage(GENERAL_ERRORS.INVALID_PRICE); + return; + } if (newStock.buyAmount !== null && isNaN(newStock.buyAmount)) { newStock.buyAmount = null; @@ -263,7 +269,11 @@ const StockPage: React.FC = () => { setIsDeleteOpen(true); // 削除ダイアログを開く return; } - if (!numericAmount || !numericBuyAmount) { + // if (!numericAmount || !numericBuyAmount) { + // showErrorMessage(GENERAL_ERRORS.INVALID_AMOUNT); + // return; + // } + if (!numericAmount) { showErrorMessage(GENERAL_ERRORS.INVALID_AMOUNT); return; }