Skip to content

Commit

Permalink
fix(CE): pagination fix for empty data (#546)
Browse files Browse the repository at this point in the history
Co-authored-by: afthab vp <[email protected]>
  • Loading branch information
RafaelOAiSquared and afthabvp authored Dec 26, 2024
1 parent 9bb9389 commit c0ce381
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/config/initializers/custom_pagination_links.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def pages_from
{}.tap do |pages|
pages[:first] = FIRST_PAGE
pages[:prev] = first_page? ? nil : collection.current_page - FIRST_PAGE
pages[:next] = last_page? ? nil : collection.current_page + FIRST_PAGE
pages[:last] = collection.total_pages
pages[:next] = (!last_page? && collection.total_pages > 1) ? collection.current_page + FIRST_PAGE : nil
pages[:last] = [collection.total_pages, FIRST_PAGE].max
end
end

Expand Down

0 comments on commit c0ce381

Please sign in to comment.