fix: 修復所有資料變更操作的快取問題

- 統一所有 CRUD 操作使用 refetch() 而非 refresh()
- 確保新增、刪除、收藏切換後畫面立即更新
- 解決刪除成功但畫面未更新的問題

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
鄭沛軒 2025-09-25 08:03:11 +08:00
parent 48bbfb867b
commit f3d1f358d6
1 changed files with 2 additions and 2 deletions

View File

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