From f3d1f358d6ab833444ec9eab50220563e06dd71c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=84=AD=E6=B2=9B=E8=BB=92?= Date: Thu, 25 Sep 2025 08:03:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=BE=A9=E6=89=80=E6=9C=89?= =?UTF-8?q?=E8=B3=87=E6=96=99=E8=AE=8A=E6=9B=B4=E6=93=8D=E4=BD=9C=E7=9A=84?= =?UTF-8?q?=E5=BF=AB=E5=8F=96=E5=95=8F=E9=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 統一所有 CRUD 操作使用 refetch() 而非 refresh() - 確保新增、刪除、收藏切換後畫面立即更新 - 解決刪除成功但畫面未更新的問題 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- frontend/app/flashcards/page.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/app/flashcards/page.tsx b/frontend/app/flashcards/page.tsx index 2d46445..a1e52b3 100644 --- a/frontend/app/flashcards/page.tsx +++ b/frontend/app/flashcards/page.tsx @@ -171,7 +171,7 @@ function FlashcardsContent() { try { const result = await flashcardsService.deleteFlashcard(card.id) if (result.success) { - await searchActions.refresh() + await searchActions.refetch() await loadTotalCounts() toast.success(`詞卡「${card.word}」已刪除`) } else { @@ -186,7 +186,7 @@ function FlashcardsContent() { try { const result = await flashcardsService.toggleFavorite(card.id) if (result.success) { - await searchActions.refresh() + await searchActions.refetch() await loadTotalCounts() toast.success(`${card.isFavorite ? '已取消收藏' : '已加入收藏'}「${card.word}」`) } else {