1. Fixed double data unwrapping in AgentChatPage
2. Fixed API URL in sendMessageStream (use relative path /api/v1)
Verified working: AI can now respond to messages
Issue: projectApi and agentApi were unwrapping response.data twice:
1. request interceptor returns response.data
2. API functions returned response.data again (undefined)
This caused all API calls to fail silently with 'response.success' being undefined.
Fixed:
- projectApi: Removed redundant .data access
- agentApi: Removed redundant .data access
All API functions now correctly return the backend response:
{ success: true, data: [...] }
This fixes:
- '鑾峰彇椤圭洰鍒楄〃澶辫触' error on page load
- '鍒涘缓椤圭洰澶辫触' error when creating projects
- Any other API call failures
Backend:
- Create project routes (GET, POST, PUT, DELETE)
- Implement projectController with CRUD operations
- Create projectService for database operations
- Add validation middleware for request validation
- Update Prisma schema (add background, researchType, deletedAt fields)
- Implement soft delete for projects
Frontend:
- Create projectApi service module
- Update useProjectStore with fetchProjects and loading state
- Connect ProjectSelector to real API with loading indicator
- Connect CreateProjectDialog to real API with error handling
- Connect EditProjectDialog to real API with loading state
- Add comprehensive error handling and user feedback
Build: Both frontend and backend build successfully