diff --git a/packages/server/src/api/controllers/table/internal.ts b/packages/server/src/api/controllers/table/internal.ts index 34bc78b243..8e90007d88 100644 --- a/packages/server/src/api/controllers/table/internal.ts +++ b/packages/server/src/api/controllers/table/internal.ts @@ -18,12 +18,16 @@ export async function save(ctx: UserCtx) { _rename?: RenameColumn } = { _id: generateTableID(), - views: {}, ...rest, // Ensure these fields are populated, even if not sent in the request type: rest.type || "table", sourceType: rest.sourceType || TableSourceType.INTERNAL, } + + if (!tableToSave.views) { + tableToSave.views = {} + } + const renaming = tableToSave._rename delete tableToSave._rename