diff --git a/composeApp/src/commonMain/kotlin/ru/csasq/cit_is_bot/ui/dialogs/ScenarioDialog.kt b/composeApp/src/commonMain/kotlin/ru/csasq/cit_is_bot/ui/dialogs/ScenarioDialog.kt index 9760b88..ad14623 100644 --- a/composeApp/src/commonMain/kotlin/ru/csasq/cit_is_bot/ui/dialogs/ScenarioDialog.kt +++ b/composeApp/src/commonMain/kotlin/ru/csasq/cit_is_bot/ui/dialogs/ScenarioDialog.kt @@ -61,6 +61,8 @@ import io.ktor.client.request.put import io.ktor.client.request.setBody import io.ktor.http.ContentType import io.ktor.http.HttpStatusCode +import io.ktor.http.URLBuilder +import io.ktor.http.URLProtocol import io.ktor.http.contentType import kotlinx.coroutines.launch import org.jetbrains.compose.resources.DrawableResource @@ -153,7 +155,16 @@ fun ScenarioDialog( scenarioDialogState.value?.name = nameState.value!! coroutine.launch { progressIndicatorState.value = true - val response = client.put("https://cit.csasq.ru/api/scripts") { + val url = URLBuilder( + protocol = URLProtocol.HTTPS, + host = "cit.csasq.ru", + pathSegments = listOf( + "api", + "scripts", + scenarioDialogState.value!!.id.toString(), + ) + ) + val response = client.put(url.build()) { contentType(ContentType.Application.Json) setBody(scenarioDialogState.value) }