From 14e0196c11320883a6c093f64292177b3a35e9a7 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Mon, 31 Aug 2020 00:51:48 +0600 Subject: [PATCH] update tools for urls --- .../insanusmokrassar/postssystem/ktor/PaginationInUrl.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ktor/common/src/commonMain/kotlin/com/insanusmokrassar/postssystem/ktor/PaginationInUrl.kt b/ktor/common/src/commonMain/kotlin/com/insanusmokrassar/postssystem/ktor/PaginationInUrl.kt index fe957a2a..60cb0244 100644 --- a/ktor/common/src/commonMain/kotlin/com/insanusmokrassar/postssystem/ktor/PaginationInUrl.kt +++ b/ktor/common/src/commonMain/kotlin/com/insanusmokrassar/postssystem/ktor/PaginationInUrl.kt @@ -12,6 +12,12 @@ val Pagination.asUrlQueryParts "size" to size.toString() ) +val Pagination.asUrlQueryArrayParts + get() = arrayOf( + "page" to page.toString(), + "size" to size.toString() + ) + val Map.extractPagination: Pagination get() = SimplePagination( get("page") ?.toIntOrNull() ?: 0,