From b41287630a4bce05aaf073b4aeccf52140111e08 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Mon, 18 Oct 2021 14:53:57 +0100 Subject: [PATCH] copy table schema and dont mutate directly --- .../src/components/backend/DataTable/DataTable.svelte | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/builder/src/components/backend/DataTable/DataTable.svelte b/packages/builder/src/components/backend/DataTable/DataTable.svelte index f1d23e8f3d..63be588931 100644 --- a/packages/builder/src/components/backend/DataTable/DataTable.svelte +++ b/packages/builder/src/components/backend/DataTable/DataTable.svelte @@ -16,22 +16,23 @@ import { Pagination } from "@budibase/bbui" let hideAutocolumns = true + let copiedSchema let schema $: isUsersTable = $tables.selected?._id === TableNames.USERS $: type = $tables.selected?.type $: isInternal = type !== "external" $: { schema = $tables.selected?.schema + copiedSchema = schema - // Manually add these as we don't want them to be 'real' auto-columns - schema._id = { + copiedSchema._id = { type: "internal", editable: false, displayName: "ID", autocolumn: true, } if (isInternal) { - schema._rev = { + copiedSchema._rev = { type: "internal", editable: false, displayName: "Revision", @@ -85,7 +86,7 @@