Skip to content

Commit

Permalink
fix(api): exception on unpaged empty content
Browse files Browse the repository at this point in the history
  • Loading branch information
gotson committed Jun 30, 2020
1 parent 4ed35d2 commit 2cc27f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class SeriesCollectionDao(
return PageImpl(
items,
if (pageable.isPaged) PageRequest.of(pageable.pageNumber, pageable.pageSize, pageSort)
else PageRequest.of(0, count.toInt(), pageSort),
else PageRequest.of(0, maxOf(count.toInt(), 20), pageSort),
count.toLong()
)
}
Expand Down Expand Up @@ -95,7 +95,7 @@ class SeriesCollectionDao(
return PageImpl(
items,
if (pageable.isPaged) PageRequest.of(pageable.pageNumber, pageable.pageSize, pageSort)
else PageRequest.of(0, count.toInt(), pageSort),
else PageRequest.of(0, maxOf(count, 20), pageSort),
count.toLong()
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class SeriesDtoDao(
return PageImpl(
dtos,
if (pageable.isPaged) PageRequest.of(pageable.pageNumber, pageable.pageSize, pageSort)
else PageRequest.of(0, count.toInt(), pageSort),
else PageRequest.of(0, maxOf(count, 20), pageSort),
count.toLong()
)
}
Expand Down

0 comments on commit 2cc27f2

Please sign in to comment.