fixes in selectPaginated

This commit is contained in:
InsanusMokrassar committed 2022-08-30 15:20:45 +06:00
1 parent 03c8830672
commit b165a76e62
2 files changed
+20 -15

No files matched your search

@@ -4,11 +4,7 @@ import org.jetbrains.exposed.sql.*
fun Query.paginate(with: Pagination, orderBy: Pair<Expression<*>, SortOrder>? = null) = limit(
with.size,
(if (orderBy ?.second == SortOrder.DESC) {
with.lastIndex
} else {
with.firstIndex
}).toLong()
with.firstIndex.toLong()
).let {
if (orderBy != null) {
it.orderBy(