diff --git a/webpack/helpers/pageParamsHelper.js b/webpack/helpers/pageParamsHelper.js index bbe5aae0..534cd428 100644 --- a/webpack/helpers/pageParamsHelper.js +++ b/webpack/helpers/pageParamsHelper.js @@ -31,7 +31,7 @@ export const useCurrentPagination = history => { */ export const pageToVars = ({ page, per_page }, totalCount = 0) => ({ first: page * per_page, - last: page > 1 && totalCount > 0 ? totalCount - per_page : per_page, + last: Math.min(per_page, totalCount - (page - 1) * per_page), }); export const useParamsToVars = (history, totalCount) =>