Cloning table schema to avoid mutation.
This commit is contained in:
parent
672e370904
commit
97e5fe37a1
|
@ -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
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue