Skip to content

Commit

Permalink
fix: 修复onSuccess不生效bug
Browse files Browse the repository at this point in the history
  • Loading branch information
zuofenghua committed Jul 1, 2021
1 parent 8c2a23a commit be70294
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/usePaginatedRequest/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,12 @@ export function usePaginatedRequest<Item = any>(
},
],
...finalOptions,
onSuccess(data) {
onSuccess(data, params) {
pagination.total = data.total;
pagination.totalPage = Math.ceil(data.total / pagination.pageSize);
if (finalOptions.onSuccess) {
finalOptions.onSuccess(data, params);
}
},
});

Expand Down

0 comments on commit be70294

Please sign in to comment.