fixes
This commit is contained in:
postssystem.core/src
commonMain
kotlin
com
insanusmokrassar
postssystem
core
post
commonTest
kotlin
com
insanusmokrassar
postssystem
core
postssystem.exposed/src/main/kotlin/com/insanusmokrassar/postssystem/core/exposed
@ -36,7 +36,7 @@ interface ReadPostsAPI {
|
||||
/**
|
||||
* @return all posts by pages basing on their creation date
|
||||
*/
|
||||
suspend fun getPostsByPagination(pagination: Pagination): PaginationResult<out RegisteredPost>
|
||||
suspend fun getPostsByPagination(pagination: Pagination): PaginationResult<RegisteredPost>
|
||||
}
|
||||
|
||||
suspend fun ReadPostsAPI.getPostsByCreatingDates(
|
||||
|
2
postssystem.core/src/commonTest/kotlin/com/insanusmokrassar/postssystem/core/api/InMemoryPostsAPI.kt
2
postssystem.core/src/commonTest/kotlin/com/insanusmokrassar/postssystem/core/api/InMemoryPostsAPI.kt
@ -76,7 +76,7 @@ class InMemoryPostsAPI(
|
||||
|
||||
override suspend fun getPostsByPagination(
|
||||
pagination: Pagination
|
||||
): PaginationResult<out RegisteredPost> = pagination.createResult(
|
||||
): PaginationResult<RegisteredPost> = pagination.createResult(
|
||||
commonObjectsNumber = posts.size,
|
||||
results = sortedByDatePosts.subList(
|
||||
pagination.firstIndex,
|
||||
|
2
postssystem.exposed/src/main/kotlin/com/insanusmokrassar/postssystem/core/exposed/ExposedPostsAPI.kt
2
postssystem.exposed/src/main/kotlin/com/insanusmokrassar/postssystem/core/exposed/ExposedPostsAPI.kt
@ -158,7 +158,7 @@ private class PostsAPIDatabaseTable(
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun getPostsByPagination(pagination: Pagination): PaginationResult<out RegisteredPost> {
|
||||
override suspend fun getPostsByPagination(pagination: Pagination): PaginationResult<RegisteredPost> {
|
||||
return transaction {
|
||||
val posts = selectAll().limit(pagination.size, pagination.firstIndex).orderBy(creationDateColumn).map {
|
||||
it.toRegisteredPost()
|
||||
|
Reference in New Issue
Block a user