fixes issues with queries not getting selected correctly
This commit is contained in:
parent
526283d406
commit
c441307611
|
@ -49,6 +49,7 @@ function createQueriesStore() {
|
||||||
return json
|
return json
|
||||||
},
|
},
|
||||||
select: query => {
|
select: query => {
|
||||||
|
update(state => ({ ...state, selected: query._id }))
|
||||||
datasources.update(state => ({ ...state, selected: query.datasourceId }))
|
datasources.update(state => ({ ...state, selected: query.datasourceId }))
|
||||||
},
|
},
|
||||||
delete: async query => {
|
delete: async query => {
|
||||||
|
|
|
@ -24,6 +24,8 @@
|
||||||
datasources.fetch()
|
datasources.fetch()
|
||||||
queries.fetch()
|
queries.fetch()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
$: console.log($queries)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if $database?._id}
|
{#if $database?._id}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
<script>
|
<script>
|
||||||
import { params } from "@sveltech/routify"
|
import { params } from "@sveltech/routify"
|
||||||
import { backendUiStore } from "builderStore"
|
import { database, queries } from 'builderStore/store/backend/'
|
||||||
import { queries } from 'builderStore/store/backend/'
|
|
||||||
import QueryInterface from "components/integration/QueryViewer.svelte"
|
import QueryInterface from "components/integration/QueryViewer.svelte"
|
||||||
|
|
||||||
async function fetchQueryConfig() {
|
async function fetchQueryConfig() {
|
||||||
|
@ -16,7 +15,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
$: selectedQuery = $queries.list.find(
|
$: selectedQuery = $queries.list.find(
|
||||||
query => query._id === $backendUiStore.selectedQueryId
|
query => query._id === $queries.selected
|
||||||
) || {
|
) || {
|
||||||
datasourceId: $params.selectedDatasource,
|
datasourceId: $params.selectedDatasource,
|
||||||
parameters: [],
|
parameters: [],
|
||||||
|
@ -27,7 +26,7 @@
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
<div class="inner">
|
<div class="inner">
|
||||||
{#if $backendUiStore.selectedDatabase._id && selectedQuery}
|
{#if $database._id && selectedQuery}
|
||||||
<QueryInterface query={selectedQuery} />
|
<QueryInterface query={selectedQuery} />
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue