fix: 修复handleBatchUpdate函数类型定义不匹配问题

- 更新UseAccountsReturn接口中handleBatchUpdate的类型签名,添加可选的targetIds参数
- 更新BatchOperationsProps接口中onBatchUpdate的类型定义以匹配实际函数签名
- 修复response.data可能为null的TypeScript严格检查错误

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-09-23 08:57:45 +08:00
parent c9af343f8e
commit 700f252454
2 changed files with 4 additions and 4 deletions

View File

@@ -47,7 +47,7 @@ export interface UseAccountsReturn {
handleSelectAll: (checked: boolean) => void;
handleSelectOne: (id: number, checked: boolean) => void;
handleBatchDelete: () => Promise<void>;
handleBatchUpdate: (payload: Partial<Pick<Account, 'status' | 'ownerId' | 'notes' | 'platform'>>) => Promise<void>;
handleBatchUpdate: (payload: Partial<Pick<Account, 'status' | 'ownerId' | 'notes' | 'platform'>>, targetIds?: number[]) => Promise<void>;
handleUploadAccounts: (accounts: ScriptUploadItem[], ownerId: string) => Promise<void>;
setSelectedIds: (ids: number[]) => void;
}
@@ -108,8 +108,8 @@ export function useAccounts(): UseAccountsReturn {
setAccounts(response.data.list);
setPagination(prev => ({
...prev,
total: response.data.pagination.total,
totalPages: response.data.pagination.totalPages
total: response.data!.pagination.total,
totalPages: response.data!.pagination.totalPages
}));
}
} catch (error) {