From da87c0233b1d9e4d1efc218f746ed7c9db1eeb15 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 14 Aug 2024 12:51:46 +0200 Subject: [PATCH] Don't trim usertable --- .../src/utilities/rowProcessor/index.ts | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/packages/server/src/utilities/rowProcessor/index.ts b/packages/server/src/utilities/rowProcessor/index.ts index 38cb34a395..59b3ea7c16 100644 --- a/packages/server/src/utilities/rowProcessor/index.ts +++ b/packages/server/src/utilities/rowProcessor/index.ts @@ -33,6 +33,7 @@ import { PROTECTED_INTERNAL_COLUMNS, } from "@budibase/shared-core" import { processString } from "@budibase/string-templates" +import { isUserMetadataTable } from "../../api/controllers/row/utils" export * from "./utils" export * from "./attachments" @@ -359,16 +360,18 @@ export async function outputProcessing( } } - const protectedColumns = isExternal - ? PROTECTED_EXTERNAL_COLUMNS - : PROTECTED_INTERNAL_COLUMNS + if (!isUserMetadataTable(table._id!)) { + const protectedColumns = isExternal + ? PROTECTED_EXTERNAL_COLUMNS + : PROTECTED_INTERNAL_COLUMNS - const tableFields = Object.keys(table.schema).filter( - f => table.schema[f].visible !== false - ) - enriched = enriched.map((r: Row) => - pick(r, [...tableFields, ...protectedColumns]) - ) + const tableFields = Object.keys(table.schema).filter( + f => table.schema[f].visible !== false + ) + enriched = enriched.map((r: Row) => + pick(r, [...tableFields, ...protectedColumns]) + ) + } return (wasArray ? enriched : enriched[0]) as T }