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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user