mirror of
https://github.com/InsanusMokrassar/PlaguPoster.git
synced 2025-11-10 16:30:04 +00:00
updates
This commit is contained in:
@@ -1,8 +1,15 @@
|
||||
package dev.inmo.plaguposter.ratings.utils
|
||||
|
||||
import dev.inmo.micro_utils.pagination.utils.getAll
|
||||
import dev.inmo.micro_utils.repos.pagination.getAll
|
||||
import dev.inmo.plaguposter.posts.models.PostId
|
||||
import dev.inmo.plaguposter.ratings.models.Rating
|
||||
import dev.inmo.plaguposter.ratings.repo.RatingsRepo
|
||||
|
||||
suspend fun RatingsRepo.postsByRatings() {
|
||||
getAll()
|
||||
suspend fun RatingsRepo.postsByRatings(): Map<Rating, List<PostId>> {
|
||||
return getAll { keys(it) }.groupBy {
|
||||
it.second
|
||||
}.map {
|
||||
it.key to it.value.map { it.first }
|
||||
}.toMap()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user