Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Commit

Permalink
UserAPI: Make eachGetOperations lambda suspendable
Browse files Browse the repository at this point in the history
  • Loading branch information
DareFox committed Jun 15, 2022
1 parent 644b39d commit d52578f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/kotlin/kmtt/api/user/IPublicUserAPI.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ interface IPublicUserAPI {
*
* @sample sampleEachOperation
*/
suspend fun <T> getAllUserComments(userID: Long, eachGetOperation: (List<Comment>) -> T): List<Comment>
suspend fun <T> getAllUserComments(userID: Long, eachGetOperation: suspend (List<Comment>) -> T): List<Comment>

/**
* Get user entries
Expand All @@ -56,7 +56,7 @@ interface IPublicUserAPI {
*
* @sample sampleEachOperation
*/
suspend fun <T> getAllUserEntries(userID: Long, eachGetOperation: (List<Entry>) -> T): List<Entry>
suspend fun <T> getAllUserEntries(userID: Long, eachGetOperation: suspend (List<Entry>) -> T): List<Entry>
}

interface IAuthUserAPI : IPublicUserAPI, Authable {
Expand Down Expand Up @@ -107,7 +107,7 @@ interface IAuthUserAPI : IPublicUserAPI, Authable {
*
* @sample sampleEachOperation
*/
suspend fun <T> getAllMyComments(eachGetOperation: (List<Comment>) -> T): List<Comment>
suspend fun <T> getAllMyComments(eachGetOperation: suspend (List<Comment>) -> T): List<Comment>

/**
* Get entries of the current user
Expand All @@ -130,7 +130,7 @@ interface IAuthUserAPI : IPublicUserAPI, Authable {
*
* @sample sampleEachOperation
*/
suspend fun <T> getAllMyEntries(eachGetOperation: (List<Entry>) -> T): List<Entry>
suspend fun <T> getAllMyEntries(eachGetOperation: suspend (List<Entry>) -> T): List<Entry>

/**
* Get the current user's favorites
Expand All @@ -153,7 +153,7 @@ interface IAuthUserAPI : IPublicUserAPI, Authable {
*
* @sample sampleEachOperation
*/
suspend fun <T> getAllMyFavoriteEntries(eachGetOperation: (List<Entry>) -> T): List<Entry>
suspend fun <T> getAllMyFavoriteEntries(eachGetOperation: suspend (List<Entry>) -> T): List<Entry>

/**
* Get the current user's favorite comments.
Expand All @@ -176,5 +176,5 @@ interface IAuthUserAPI : IPublicUserAPI, Authable {
*
* @sample sampleEachOperation
*/
suspend fun <T> getAllMyFavoriteComments(eachGetOperation: (List<Comment>) -> T): List<Comment>
suspend fun <T> getAllMyFavoriteComments(eachGetOperation: suspend (List<Comment>) -> T): List<Comment>
}

0 comments on commit d52578f

Please sign in to comment.