1
0
Fork 0
mirror of synced 2024-08-12 00:22:02 +12:00

Cloning table schema to avoid mutation.

This commit is contained in:
mike12345567 2023-08-14 11:19:00 +01:00
parent 672e370904
commit 97e5fe37a1

View file

@ -1,11 +1,11 @@
import {
FieldSchema,
RenameColumn,
TableSchema,
View,
ViewV2,
} from "@budibase/types"
import { context, HTTPError } from "@budibase/backend-core"
import { cloneDeep } from "lodash"
import sdk from "../../../sdk"
import * as utils from "../../../db/utils"
@ -78,7 +78,7 @@ export function enrichSchema(view: View | ViewV2, tableSchema: TableSchema) {
return view
}
let schema = { ...tableSchema }
let schema = cloneDeep(tableSchema)
const anyViewOrder = Object.values(view.schema || {}).some(
ui => ui.order != null
)