解決詞卡保存"Failed to create flashcard"錯誤的完整修復: **主要修復**: - CardSetId設為可選欄位,避免外鍵約束問題 - 自動創建測試用戶解決外鍵參考失敗 - 移除Entity Framework的ValueGenerated衝突 - 更新API服務使用環境變數配置 **技術改進**: - Flashcard.CardSetId: Guid → Guid? (nullable) - DbContext外鍵關係: IsRequired(false) + SetNull刪除行為 - 控制器: 自動測試用戶創建邏輯 - 前端服務: 環境變數API URL配置 **測試驗證**: ✅ 詞卡創建成功 (POST /api/flashcards-simple) ✅ 重複檢測正常運作 ✅ 完整開發計劃文檔更新 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| DramaLing.Api | ||