diff --git a/core/ktor/client/src/commonMain/kotlin/dev/inmo/postssystem/core/ktor/client/post/PostsRepoKtorClient.kt b/core/ktor/client/src/commonMain/kotlin/dev/inmo/postssystem/core/ktor/client/post/PostsRepoKtorClient.kt index 6b837a0a..744029af 100644 --- a/core/ktor/client/src/commonMain/kotlin/dev/inmo/postssystem/core/ktor/client/post/PostsRepoKtorClient.kt +++ b/core/ktor/client/src/commonMain/kotlin/dev/inmo/postssystem/core/ktor/client/post/PostsRepoKtorClient.kt @@ -11,17 +11,17 @@ class PostsRepoKtorClient private constructor( ) : PostsRepo, ReadPostsRepo by readPostsRepo, WritePostsRepo by writePostsRepo { constructor( baseUrl: String, - rootRoute: String = postsRootRoute, + rootRoute: String? = postsRootRoute, client: HttpClient = HttpClient { install(WebSockets) } ) : this( ReadPostsRepoKtorClient( - "${baseUrl}/$rootRoute", + rootRoute ?.let { "${baseUrl}/$rootRoute" } ?: baseUrl, client ), WritePostsRepoKtorClient( - "${baseUrl}/$rootRoute", + rootRoute ?.let { "${baseUrl}/$rootRoute" } ?: baseUrl, client ) ) diff --git a/publishing/ktor/client/src/commonMain/kotlin/com/insanusmokrassar/postssystem/publishing/ktor/client/PublishingKeysRepoKtorClient.kt b/publishing/ktor/client/src/commonMain/kotlin/com/insanusmokrassar/postssystem/publishing/ktor/client/PublishingKeysRepoKtorClient.kt index 62fbfcdb..b83a46c9 100644 --- a/publishing/ktor/client/src/commonMain/kotlin/com/insanusmokrassar/postssystem/publishing/ktor/client/PublishingKeysRepoKtorClient.kt +++ b/publishing/ktor/client/src/commonMain/kotlin/com/insanusmokrassar/postssystem/publishing/ktor/client/PublishingKeysRepoKtorClient.kt @@ -11,16 +11,17 @@ class PublishingKeysRepoKtorClient private constructor ( ) : PublishingKeysRepo, ReadPublishingKeysRepo by readPublishingKeysClient, WritePublishingKeysRepo by writePublishingKeysClient { constructor( baseUrl: String, + subpath: String? = publishingKeysRootRoute, client: HttpClient = HttpClient { install(WebSockets) } ) : this ( ReadPublishingKeysRepoKtorClient ( - "$baseUrl/$publishingKeysRootRoute", + subpath ?.let { "$baseUrl/$subpath" } ?: baseUrl, client ), WritePublishingKeysRepoKtorClient( - "$baseUrl/$publishingKeysRootRoute", + subpath ?.let { "$baseUrl/$subpath" } ?: baseUrl, client ) )