diff --git a/network/src/commonMain/kotlin/com/wire/kalium/network/api/v0/authenticated/PreKeyApiV0.kt b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v0/authenticated/PreKeyApiV0.kt index 004da3d89cc..ebdcbe8d7f8 100644 --- a/network/src/commonMain/kotlin/com/wire/kalium/network/api/v0/authenticated/PreKeyApiV0.kt +++ b/network/src/commonMain/kotlin/com/wire/kalium/network/api/v0/authenticated/PreKeyApiV0.kt @@ -55,7 +55,7 @@ internal open class PreKeyApiV0 internal constructor( override suspend fun uploadNewPrekeys(clientId: String, preKeys: List): NetworkResponse = wrapKaliumResponse { - httpClient.put("$PATH_CLIENTS/$clientId/$PATH_PRE_KEY") { + httpClient.put("$PATH_CLIENTS/$clientId") { setBody(UploadPreKeysRequest(preKeys)) } } diff --git a/network/src/commonTest/kotlin/com/wire/kalium/api/v0/prekey/PrekeyApiV0Test.kt b/network/src/commonTest/kotlin/com/wire/kalium/api/v0/prekey/PrekeyApiV0Test.kt index 2aac58661de..05747f06304 100644 --- a/network/src/commonTest/kotlin/com/wire/kalium/api/v0/prekey/PrekeyApiV0Test.kt +++ b/network/src/commonTest/kotlin/com/wire/kalium/api/v0/prekey/PrekeyApiV0Test.kt @@ -83,10 +83,12 @@ internal class PrekeyApiV0Test : ApiTest() { @Test fun givenPreKeyAndClientId_whenUploadingPreKeys_thenTheRequestIsConfiguredCorrectly() = runTest { val preKeyDTO = PreKeyDTO(42, "testKey") + val clientId = "testClientId" val networkClient = mockAuthenticatedNetworkClient( responseBody = "", statusCode = HttpStatusCode.OK, assertion = { + assertPathEqual("/clients/$clientId") assertJson() assertJsonBodyContent( """ @@ -103,7 +105,7 @@ internal class PrekeyApiV0Test : ApiTest() { } ) val preKeyApi: PreKeyApi = PreKeyApiV0(networkClient) - val response = preKeyApi.uploadNewPrekeys("clientId", listOf(preKeyDTO)) + val response = preKeyApi.uploadNewPrekeys(clientId, listOf(preKeyDTO)) assertTrue(response.isSuccessful()) }