From 3c4ca81293421a7ba9468166c8d94f0ffa5e8983 Mon Sep 17 00:00:00 2001 From: y9Kap Date: Sun, 22 Oct 2023 23:14:55 +0300 Subject: [PATCH] fix(#76-support-auth-header): change name of field avatarId --- .../engine/ktor/requests/extencion/RequestBodyPost.kt | 6 +++--- .../engine/ktor/requests/meetings/MeetingsEngine.kt | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/extencion/RequestBodyPost.kt b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/extencion/RequestBodyPost.kt index c2370ef6..e4a449c9 100644 --- a/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/extencion/RequestBodyPost.kt +++ b/api/api-ktor/src/commonMain/kotlin/app/meetacy/sdk/engine/ktor/requests/extencion/RequestBodyPost.kt @@ -14,8 +14,8 @@ public suspend inline fun > post( jsonObject: JsonObject, httpClient: HttpClient, request: R -): String { - return httpClient.post(urlString) { +): String = + httpClient.post(urlString) { setBody( TextContent( text = jsonObject.toString(), @@ -25,7 +25,7 @@ public suspend inline fun > post( header("Authorization", request.token.string) header("Api-Version", request.apiVersion.int.toString()) }.body() -} + public suspend inline fun > postWithoutToken( url: String, 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 dc2aa091..a8a43984 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 @@ -40,7 +40,7 @@ internal class MeetingsEngine( val url = baseUrl / "meetings" / "history" / "list" val jsonObject = buildJsonObject { - put("amount", amount.int) + put("amount", amount.int.toString()) put("pagingId", pagingId?.string) } @@ -62,7 +62,7 @@ internal class MeetingsEngine( val url = baseUrl / "meetings" / "history" / "active" val jsonObject = buildJsonObject { - put("amount", amount.int) + put("amount", amount.int.toString()) put("pagingId", pagingId?.string) } @@ -84,7 +84,7 @@ internal class MeetingsEngine( val url = baseUrl / "meetings" / "history" / "past" val jsonObject = buildJsonObject { - put("amount", amount.int) + put("amount", amount.int.toString()) put("pagingId", pagingId?.string) } @@ -127,14 +127,14 @@ internal class MeetingsEngine( val jsonObject = buildJsonObject { put("title", title) + put("description", description) put("date", date.iso8601) putJsonObject("location") { put("latitude", location.latitude) put("longitude", location.longitude) } - put("description", description) put("visibility", visibility.name.lowercase()) - put("fileId", fileId?.string) + put("avatarId", fileId?.string) } val string = httpClient.post(url.string) {