This commit is contained in:
2020-07-30 19:44:47 +06:00
parent 3baf6cc3c6
commit 43f148bf4b
8 changed files with 267 additions and 0 deletions

View File

@@ -20,3 +20,8 @@ fun Query.paginate(with: Pagination, orderBy: Pair<Expression<*>, SortOrder>? =
it
}
}
fun Query.paginate(with: Pagination, orderBy: Expression<*>?, reversed: Boolean = false) = paginate(
with,
orderBy ?.let { it to if (reversed) SortOrder.DESC else SortOrder.ASC }
)