Skip to content

Commit 987cd8d

Browse files
authored
Merge pull request #304 from ByeongUkChoi/feature/fix_pagination
Bug fix pagination
2 parents c4f7192 + ca4a463 commit 987cd8d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/kaffy/pagination.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ defmodule Kaffy.Pagination do
44
# number of pages to show on the showleft/right of the current page
55
@pagination_delta 2
66

7-
def get_pages(0, 0), do: []
7+
def get_pages(1, 0), do: []
88

99
def get_pages(current_page, total_page) do
1010
showleft = current_page - @pagination_delta

test/pagination_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ defmodule Kaffy.PaginationTest do
55
# testing for get_pages(current_page, total_page)
66

77
test "test on empty pages" do
8-
pages = Pagination.get_pages(0, 0)
8+
pages = Pagination.get_pages(1, 0)
99
assert pages == []
1010
end
1111

0 commit comments

Comments
 (0)