From 6c1c0e7bb02843a8088a011dbfb224605c201dd7 Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Wed, 20 May 2020 15:11:04 +0200 Subject: Support relative links for remote endpoints --- .../main/kotlin/pl/treksoft/kvision/form/text/TypeaheadRemoteInput.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'kvision-modules/kvision-bootstrap-typeahead-remote/src') diff --git a/kvision-modules/kvision-bootstrap-typeahead-remote/src/main/kotlin/pl/treksoft/kvision/form/text/TypeaheadRemoteInput.kt b/kvision-modules/kvision-bootstrap-typeahead-remote/src/main/kotlin/pl/treksoft/kvision/form/text/TypeaheadRemoteInput.kt index 0693756b..932a86ff 100644 --- a/kvision-modules/kvision-bootstrap-typeahead-remote/src/main/kotlin/pl/treksoft/kvision/form/text/TypeaheadRemoteInput.kt +++ b/kvision-modules/kvision-bootstrap-typeahead-remote/src/main/kotlin/pl/treksoft/kvision/form/text/TypeaheadRemoteInput.kt @@ -57,14 +57,14 @@ open class TypeaheadRemoteInput( ) : TypeaheadInput(null, null, items, minLength, delay, type, value, classes) { private val kvUrlPrefix = window["kv_remote_url_prefix"] - private val urlPrefix: String = if (kvUrlPrefix != undefined) kvUrlPrefix else "" + private val urlPrefix: String = if (kvUrlPrefix != undefined) "$kvUrlPrefix/" else "" init { val (url, method) = serviceManager.getCalls()[function.toString().replace("\\s".toRegex(), "")] ?: throw IllegalStateException("Function not specified!") this.ajaxOptions = TaAjaxOptions( - urlPrefix + url, + urlPrefix + url.drop(1), preprocessQuery = { query -> val state = stateFunction?.invoke() JSON.plain.stringify(JsonRpcRequest(0, url, listOf(query, state))) -- cgit