refactor(api): migrate expression-api to ApiResponse pattern

- Migrated all 11 functions in expression-api.ts to return Promise<ApiResponse<T>>
- Implemented manual response handling following person-api pattern
- Properly unwrap nested API responses and re-wrap in ApiResponse
- Updated all 16 call sites across 4 files with proper error handling
- Fixed type annotations (ChatInfo) in expression.tsx
- Build passes successfully with no TypeScript errors
- Follows AGENTS.md import conventions and Wave 2 constraints
- All HTTP and API-level errors handled consistently via ApiResponse
This commit is contained in:
DrSmoothl
2026-03-01 17:26:34 +08:00
parent c863d5a3be
commit 88e157040f
7 changed files with 812 additions and 199 deletions

View File

@@ -161,9 +161,9 @@ function IndexPageContent() {
// 获取审核统计
const fetchReviewStats = useCallback(async () => {
try {
const data = await getReviewStats()
if (isMountedRef.current) {
setUncheckedCount(data.unchecked)
const result = await getReviewStats()
if (result.success && isMountedRef.current) {
setUncheckedCount(result.data.unchecked)
}
} catch (error) {
console.error('获取审核统计失败:', error)