fix(#201): fix platforms endpoint response shape mismatch

GET /api/messaging/platforms returns a JSON object with a platforms
array inside, but the app expected a bare array. Wraps the response
in a new MessagingPlatformResponse model.

- Adds MessagingPlatformResponse.kt wrapper model
- Updates HermesApiService.kt return type + adds profile query param
- Updates ChannelsViewModel.kt to unwrap .platforms
- Updates E2eIntegrationTest.kt mock to match new response shape
This commit is contained in:
M57 committed 2026-06-21 16:03:36 +03:00
1 parent a89b932a0e
commit 35c608b2bf
4 files changed
+19 -4

No files matched your search

@@ -14,6 +14,7 @@ import com.m57.hermescontrol.data.model.KanbanColumn
import com.m57.hermescontrol.data.model.KanbanTask
import com.m57.hermescontrol.data.model.LogResponse
import com.m57.hermescontrol.data.model.MessagingPlatform
import com.m57.hermescontrol.data.model.MessagingPlatformResponse
import com.m57.hermescontrol.data.model.ModelOptionsResponse
import com.m57.hermescontrol.data.model.ModelProvider
import com.m57.hermescontrol.data.model.PluginInfo
@@ -895,7 +896,14 @@ class E2eIntegrationTest {
fun testChannelsConfiguration_success() =
runTest {
val platform = MessagingPlatform("telegram", "Telegram", false, false, emptyList())
coEvery { mockApiService.getMessagingPlatforms() } returns Response.success(listOf(platform))
coEvery { mockApiService.getMessagingPlatforms() } returns
Response.success(
MessagingPlatformResponse(
env_path = "/tmp/.env",
gateway_start_command = "hermes gateway start",
platforms = listOf(platform),
),
)
coEvery { mockApiService.configurePlatform("telegram", any()) } returns Response.success(Unit)
val viewModel = ChannelsViewModel()