fix test connection

This commit is contained in:
Ruben Fiszel
2023-07-20 08:09:48 +02:00
parent 87866f12bb
commit 145a797eae
2 changed files with 8 additions and 7 deletions
@@ -68,7 +68,7 @@
right: 'As JSON'
}}
/>
<TestConnection {resource_type} />
<TestConnection {resource_type} {args} />
</div>
{:else}
<p class="italic text-gray-500 text-xs mb-4"
@@ -12,11 +12,7 @@
let loading = false
async function testConnection() {
loading = true
const job = await JobService.runScriptPreview({
workspace: $workspaceStore!,
requestBody: {
language: 'deno' as Preview.language,
content: `
const content = `
import { Client } from 'https://deno.land/x/postgres/mod.ts'
export async function main(args: any) {
const u = new URL("postgres://")
@@ -30,7 +26,12 @@ export async function main(args: any) {
await client.connect()
return 'Connection successful'
}
`,
`
const job = await JobService.runScriptPreview({
workspace: $workspaceStore!,
requestBody: {
language: 'deno' as Preview.language,
content,
args: {
args
}