Skip to content

Commit

Permalink
feat: Default sorting for query logs
Browse files Browse the repository at this point in the history
  • Loading branch information
tien committed May 3, 2021
1 parent a698474 commit 1106e09
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,14 @@ class PiHoleRepositoryImpl @Inject constructor(
override suspend fun getLogs(limit: Int): PiHoleLogs =
withContext(Dispatchers.IO) {
baseRequestFlow.first().let { (httpClient, requestBuilder) ->
httpClient.get {
val response = httpClient.get<PiHoleLogs> {
requestBuilder(this)
url {
parameters["getAllQueries"] = limit.toString()
}
}

response.copy(data = response.data.sortedByDescending { it.timestamp })
}
}

Expand Down

0 comments on commit 1106e09

Please sign in to comment.