From ed60a1fb1afed2d5229294789b3f958abb7e288c Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 6 Oct 2021 15:31:32 +0100 Subject: [PATCH] Fixing an issue with new data source creation, could not view fetched tables until refresh page. --- packages/auth/src/redis/index.js | 6 ++++++ .../DatasourceNavigator/modals/DatasourceConfigModal.svelte | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/auth/src/redis/index.js b/packages/auth/src/redis/index.js index 48a24ad0bc..0ee17265ce 100644 --- a/packages/auth/src/redis/index.js +++ b/packages/auth/src/redis/index.js @@ -191,6 +191,12 @@ class RedisWrapper { } } + async getTTL(key) { + const db = this._db + const prefixedKey = addDbPrefix(db, key) + return CLIENT.ttl(prefixedKey) + } + async setExpiry(key, expirySeconds) { const db = this._db const prefixedKey = addDbPrefix(db, key) diff --git a/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte b/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte index 56fa26ee0a..ca8d29708e 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte @@ -3,7 +3,7 @@ import { ModalContent, notifications, Body, Layout } from "@budibase/bbui" import analytics, { Events } from "analytics" import IntegrationConfigForm from "components/backend/DatasourceNavigator/TableIntegrationMenu/IntegrationConfigForm.svelte" - import { datasources } from "stores/backend" + import { datasources, tables } from "stores/backend" import { IntegrationNames } from "constants" export let integration @@ -32,6 +32,8 @@ // Create datasource const resp = await datasources.save(datasource, datasource.plus) + // update the tables incase data source plus + await tables.fetch() await datasources.select(resp._id) $goto(`./datasource/${resp._id}`) notifications.success(`Datasource updated successfully.`)