Browse Source

Adding placeholder and making sure query urls have a protocol.

pull/3741/head
mike12345567 5 years ago
parent
commit
dad8524023
  1. 2
      packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/rest/[query]/index.svelte
  2. 8
      packages/server/src/integrations/rest.ts

2
packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/rest/[query]/index.svelte

@ -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>

8
packages/server/src/integrations/rest.ts

@ -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…
Cancel
Save