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:
@@ -13,7 +13,7 @@ interface BatchOperationsProps {
|
||||
selectedCount: number;
|
||||
selectedAccounts: Account[];
|
||||
stats: StatsOverview | null;
|
||||
onBatchUpdate: (payload: Partial<Pick<Account, 'status' | 'ownerId' | 'notes' | 'platform'>>) => Promise<void>;
|
||||
onBatchUpdate: (payload: Partial<Pick<Account, 'status' | 'ownerId' | 'notes' | 'platform'>>, targetIds?: number[]) => Promise<void>;
|
||||
onBatchDelete: () => Promise<void>;
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user