From 0737af7225f6fe04f018a91ca5eaa64d469bf716 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sat, 21 Oct 2023 12:06:46 +0530 Subject: [PATCH] fix: pass meta as prop of an object Signed-off-by: Pranav C --- packages/nocodb/src/models/Column.ts | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/packages/nocodb/src/models/Column.ts b/packages/nocodb/src/models/Column.ts index 389472e458..7fcabb551d 100644 --- a/packages/nocodb/src/models/Column.ts +++ b/packages/nocodb/src/models/Column.ts @@ -27,7 +27,7 @@ import { MetaTable, } from '~/utils/globals'; import NocoCache from '~/cache/NocoCache'; -import { stringifyMetaProp } from '~/utils/modelUtils'; +import { parseMetaProp, stringifyMetaProp } from '~/utils/modelUtils'; const selectColors = [ '#cfdffe', @@ -496,13 +496,7 @@ export default class Column implements ColumnType { }); columnsList.forEach((column) => { - if (column.meta && typeof column.meta === 'string') { - try { - column.meta = JSON.parse(column.meta); - } catch { - column.meta = {}; - } - } + column.meta = parseMetaProp(column); }); await NocoCache.setList(CacheScope.COLUMN, [fk_model_id], columnsList); @@ -1277,7 +1271,7 @@ export default class Column implements ColumnType { null, MetaTable.COLUMNS, { - meta: stringifyMetaProp(meta), + meta: stringifyMetaProp({ meta }), }, colId, );