fixes
This commit is contained in:
parent
5859c8bb44
commit
8efccf6672
@ -36,7 +36,7 @@ interface ReadPostsAPI {
|
|||||||
/**
|
/**
|
||||||
* @return all posts by pages basing on their creation date
|
* @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(
|
suspend fun ReadPostsAPI.getPostsByCreatingDates(
|
||||||
|
@ -76,7 +76,7 @@ class InMemoryPostsAPI(
|
|||||||
|
|
||||||
override suspend fun getPostsByPagination(
|
override suspend fun getPostsByPagination(
|
||||||
pagination: Pagination
|
pagination: Pagination
|
||||||
): PaginationResult<out RegisteredPost> = pagination.createResult(
|
): PaginationResult<RegisteredPost> = pagination.createResult(
|
||||||
commonObjectsNumber = posts.size,
|
commonObjectsNumber = posts.size,
|
||||||
results = sortedByDatePosts.subList(
|
results = sortedByDatePosts.subList(
|
||||||
pagination.firstIndex,
|
pagination.firstIndex,
|
||||||
|
@ -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 {
|
return transaction {
|
||||||
val posts = selectAll().limit(pagination.size, pagination.firstIndex).orderBy(creationDateColumn).map {
|
val posts = selectAll().limit(pagination.size, pagination.firstIndex).orderBy(creationDateColumn).map {
|
||||||
it.toRegisteredPost()
|
it.toRegisteredPost()
|
||||||
|
Loading…
Reference in New Issue
Block a user