Skip to content

Commit

Permalink
Merge pull request #304 from ByeongUkChoi/feature/fix_pagination
Browse files Browse the repository at this point in the history
Bug fix pagination
  • Loading branch information
aesmail authored Nov 13, 2023
2 parents c4f7192 + ca4a463 commit 987cd8d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/kaffy/pagination.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule Kaffy.Pagination do
# number of pages to show on the showleft/right of the current page
@pagination_delta 2

def get_pages(0, 0), do: []
def get_pages(1, 0), do: []

def get_pages(current_page, total_page) do
showleft = current_page - @pagination_delta
Expand Down
2 changes: 1 addition & 1 deletion test/pagination_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defmodule Kaffy.PaginationTest do
# testing for get_pages(current_page, total_page)

test "test on empty pages" do
pages = Pagination.get_pages(0, 0)
pages = Pagination.get_pages(1, 0)
assert pages == []
end

Expand Down

0 comments on commit 987cd8d

Please sign in to comment.