From af45b5d3da134321fc6f2915f1cb7266bf7a3c0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=84=AD=E6=B2=9B=E8=BB=92?= Date: Wed, 24 Sep 2025 01:47:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=BE=A9=E5=89=8D=E7=AB=AFType?= =?UTF-8?q?Script=E9=A1=9E=E5=9E=8B=E9=8C=AF=E8=AA=A4=EF=BC=8C=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E9=87=8D=E5=91=BD=E5=90=8D=E7=B5=B1=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修復重命名過程中遺留的類型定義問題: - 更新所有SimpleFlashcard類型引用為Flashcard - 清理Next.js webpack快取解決編譯錯誤 - 確保前端服務正確連接到新的/api/flashcards端點 ✅ 前端重新編譯成功,所有類型錯誤已解決 ✅ 智能詞卡生成和保存功能現已完全正常 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- frontend/lib/services/flashcards.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/lib/services/flashcards.ts b/frontend/lib/services/flashcards.ts index 3bd0648..64b220b 100644 --- a/frontend/lib/services/flashcards.ts +++ b/frontend/lib/services/flashcards.ts @@ -57,7 +57,7 @@ class FlashcardsService { } // 簡化的詞卡方法 - async getFlashcards(search?: string, favoritesOnly: boolean = false): Promise> { + async getFlashcards(search?: string, favoritesOnly: boolean = false): Promise> { try { const params = new URLSearchParams(); if (search) params.append('search', search); @@ -66,7 +66,7 @@ class FlashcardsService { const queryString = params.toString(); const endpoint = `/flashcards${queryString ? `?${queryString}` : ''}`; - return await this.makeRequest>(endpoint); + return await this.makeRequest>(endpoint); } catch (error) { return { success: false, @@ -75,7 +75,7 @@ class FlashcardsService { } } - async createFlashcard(data: CreateSimpleFlashcardRequest): Promise> { + async createFlashcard(data: CreateFlashcardRequest): Promise> { try { return await this.makeRequest>('/flashcards', { method: 'POST', @@ -102,7 +102,7 @@ class FlashcardsService { } } - async getFlashcard(id: string): Promise> { + async getFlashcard(id: string): Promise> { try { return await this.makeRequest>(`/flashcards/${id}`); } catch (error) { @@ -113,7 +113,7 @@ class FlashcardsService { } } - async updateFlashcard(id: string, data: CreateSimpleFlashcardRequest): Promise> { + async updateFlashcard(id: string, data: CreateFlashcardRequest): Promise> { try { return await this.makeRequest>(`/flashcards/${id}`, { method: 'PUT',