Adding placeholder and making sure query urls have a protocol.
This commit is contained in:
parent
4dd8dbc253
commit
e1ae7c603d
|
@ -176,7 +176,7 @@
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="url">
|
<div class="url">
|
||||||
<Input bind:value={url} />
|
<Input bind:value={url} placeholder="http://www.api.com/endpoint" />
|
||||||
</div>
|
</div>
|
||||||
<Button cta disabled={!url} on:click={runQuery}>Send</Button>
|
<Button cta disabled={!url} on:click={runQuery}>Send</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -146,11 +146,11 @@ module RestModule {
|
||||||
|
|
||||||
getUrl(path: string, queryString: string): string {
|
getUrl(path: string, queryString: string): string {
|
||||||
const main = `${path}?${queryString}`
|
const main = `${path}?${queryString}`
|
||||||
if (!this.config.url) {
|
let complete = !this.config.url ? main : `${this.config.url}/${main}`
|
||||||
return main
|
if (!complete.startsWith("http")) {
|
||||||
} else {
|
complete = `http://${complete}`
|
||||||
return `${this.config.url}/${main}`
|
|
||||||
}
|
}
|
||||||
|
return complete
|
||||||
}
|
}
|
||||||
|
|
||||||
async _req(query: RestQuery) {
|
async _req(query: RestQuery) {
|
||||||
|
|
Loading…
Reference in New Issue