Skip to content

Commit

Permalink
fix user list get
Browse files Browse the repository at this point in the history
  • Loading branch information
stslex committed Aug 7, 2023
1 parent b133a88 commit bafc37a
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package com.stslex.aproselection.core.network.clients.user
import com.stslex.aproselection.core.network.client.NetworkClient
import com.stslex.aproselection.core.network.clients.user.model.UpdateUserInfoBody
import com.stslex.aproselection.core.network.clients.user.model.UserResponse
import com.stslex.aproselection.core.network.model.PagingRequest
import io.ktor.client.call.body
import io.ktor.client.request.get
import io.ktor.client.request.post
import io.ktor.client.request.setBody
import io.ktor.http.appendPathSegments
import io.ktor.util.AttributeKey
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext

Expand All @@ -22,10 +22,12 @@ class UserNetworkClientImpl(
): List<UserResponse> = withContext(Dispatchers.IO) {
networkClient.apiClient.get {
url.appendPathSegments("user", "list")
setAttributes {
put(AttributeKey("page_size"), pageSize)
put(AttributeKey("page_number"), page)
}
setBody(
PagingRequest(
pageSize = pageSize,
pageNumber = page
)
)
}.body()
}

Expand Down

0 comments on commit bafc37a

Please sign in to comment.