Link datasource dynamic variables table to query

This commit is contained in:
Rory Powell 2021-12-14 17:05:17 +00:00
parent fc719eda27
commit f499320b47
1 changed files with 9 additions and 0 deletions

View File

@ -1,6 +1,8 @@
<script>
import { Body, Table } from "@budibase/bbui"
import { onMount } from "svelte"
import { queries as queriesStore } from "stores/backend"
import { goto } from "@roxi/routify"
export let datasource
export let queries
@ -13,6 +15,12 @@
query: "",
}
const onClick = dynamicVariable => {
const queryId = dynamicVariable.queryId
queriesStore.select({ _id: queryId })
$goto(`./${queryId}`)
}
/**
* Add the query name to the dynamic variables
*/
@ -31,6 +39,7 @@
</script>
<Table
on:click={({ detail }) => onClick(detail)}
schema={dynamicVariableSchema}
data={dynamicVariables}
allowEditColumns={false}