数量修正

feature-backend-stock-fix
akito.nishiwaki 4 months ago
parent 1ff7cfeb88
commit 08235b4159
  1. 11
      frontend/src/pages/TaskListPage.tsx

@ -136,13 +136,16 @@ const TaskListPage: React.FC = () => {
try {
const today = new Date().toISOString().substring(0, 10);
const parsedPrice = parseInt(newPrice, 10);
if (!isNaN(parsedPrice)) {
setNewStock({ ...newStock, price: parsedPrice });
}else{
console.log("newPrice")
console.log(newPrice)
console.log("parsedPrice")
console.log(parsedPrice)
if (isNaN(parsedPrice)) {
alert('入力が無効です')
return
//setNewStock({ ...newStock, price: parsedPrice });
}
await toBuyApi.buy({ tobuyId, ...newStock, lastUpdate: today }); //データベースに送信
await toBuyApi.buy({ tobuyId, ...newStock, price: parsedPrice, lastUpdate: today }); //データベースに送信
fetchTasks(); // 削除後の買うもの一覧を再取得
} catch (error) {
console.error(`${TOBUY_ERRORS.BUY_FAILED}:`, error);

Loading…
Cancel
Save