We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c4f7192 + ca4a463 commit 987cd8dCopy full SHA for 987cd8d
lib/kaffy/pagination.ex
@@ -4,7 +4,7 @@ defmodule Kaffy.Pagination do
4
# number of pages to show on the showleft/right of the current page
5
@pagination_delta 2
6
7
- def get_pages(0, 0), do: []
+ def get_pages(1, 0), do: []
8
9
def get_pages(current_page, total_page) do
10
showleft = current_page - @pagination_delta
test/pagination_test.exs
@@ -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
11
0 commit comments