diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt index f674c95..662613e 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/meetings/MeetingsEngine.kt @@ -74,21 +74,15 @@ internal class MeetingsEngine( return ListMeetingsHistoryRequest.Response(response) } - private fun ListActiveMeetingsRequest.toBody() = ListMeetingsPagingBody( - amount.serializable(), - pagingId?.serializable() - ) - suspend fun listActiveMeetings( request: ListActiveMeetingsRequest ): ListActiveMeetingsRequest.Response { val url = baseUrl / "history" / "active" - val body = request.toBody() - val response = httpClient.get(url.string) { apiVersion(request.apiVersion) token(request.token) - setBody(body) + parameter("amount", request.amount.int) + parameter("pagingId", request.pagingId?.string) }.bodyAsSuccess>() .type() .mapItems { meeting -> meeting.type() } @@ -96,21 +90,15 @@ internal class MeetingsEngine( return ListActiveMeetingsRequest.Response(response) } - private fun ListPastMeetingsRequest.toBody() = ListMeetingsPagingBody( - amount.serializable(), - pagingId?.serializable() - ) - suspend fun listPastMeetings( request: ListPastMeetingsRequest ): ListPastMeetingsRequest.Response { val url = baseUrl / "history" / "past" - val body = request.toBody() - - val response = httpClient.post(url.string) { + val response = httpClient.get(url.string) { apiVersion(request.apiVersion) token(request.token) - setBody(body) + parameter("amount", request.amount.int) + parameter("pagingId", request.pagingId?.string) }.bodyAsSuccess>() .type() .mapItems { meeting -> meeting.type() } @@ -162,7 +150,7 @@ internal class MeetingsEngine( suspend fun createMeeting( request: CreateMeetingRequest - ): CreateMeetingRequest.Response = with(request) { + ): CreateMeetingRequest.Response { val url = baseUrl / "create" val body = request.toBody() val response = httpClient.post(url.string) {