fix: 修復所有資料變更操作的快取問題
- 統一所有 CRUD 操作使用 refetch() 而非 refresh() - 確保新增、刪除、收藏切換後畫面立即更新 - 解決刪除成功但畫面未更新的問題 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
48bbfb867b
commit
f3d1f358d6
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue