From c28bfff0ec405216c599ed93f204d747209af6c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Keviin=20=C3=85berg=20Kultalahti?= Date: Tue, 23 Mar 2021 10:56:53 +0100 Subject: [PATCH] fixes issues with queries not getting selected correctly --- packages/builder/src/builderStore/store/backend/queries.js | 1 + .../backend/DatasourceNavigator/DatasourceNavigator.svelte | 2 ++ .../datasource/[selectedDatasource]/[query]/index.svelte | 7 +++---- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/builder/src/builderStore/store/backend/queries.js b/packages/builder/src/builderStore/store/backend/queries.js index 68851f59ee..9e4490a7f0 100644 --- a/packages/builder/src/builderStore/store/backend/queries.js +++ b/packages/builder/src/builderStore/store/backend/queries.js @@ -49,6 +49,7 @@ function createQueriesStore() { return json }, select: query => { + update(state => ({ ...state, selected: query._id })) datasources.update(state => ({ ...state, selected: query.datasourceId })) }, delete: async query => { diff --git a/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte b/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte index f101bee181..a0e5c783b9 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte @@ -24,6 +24,8 @@ datasources.fetch() queries.fetch() }) + + $: console.log($queries) {#if $database?._id} diff --git a/packages/builder/src/pages/[application]/data/datasource/[selectedDatasource]/[query]/index.svelte b/packages/builder/src/pages/[application]/data/datasource/[selectedDatasource]/[query]/index.svelte index 62332f405d..8fc21249b7 100644 --- a/packages/builder/src/pages/[application]/data/datasource/[selectedDatasource]/[query]/index.svelte +++ b/packages/builder/src/pages/[application]/data/datasource/[selectedDatasource]/[query]/index.svelte @@ -1,7 +1,6 @@