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