cleanup.
This commit is contained in:
parent
7be67bf603
commit
1e4cbc769c
|
@ -2,11 +2,11 @@ import sdk from "../../../sdk"
|
|||
import {
|
||||
CreateViewRequest,
|
||||
Ctx,
|
||||
RequiredKeys,
|
||||
UIFieldMetadata,
|
||||
UpdateViewRequest,
|
||||
ViewResponse,
|
||||
ViewV2,
|
||||
RequiredKeys,
|
||||
} from "@budibase/types"
|
||||
import { builderSocket } from "../../../websockets"
|
||||
|
||||
|
@ -19,7 +19,7 @@ async function parseSchemaUI(ctx: Ctx, view: CreateViewRequest) {
|
|||
newObj: Record<string, any>,
|
||||
existingObj: Record<string, any>
|
||||
) {
|
||||
const result = Object.entries(newObj || {}).some(([key, value]) => {
|
||||
return Object.entries(newObj || {}).some(([key, value]) => {
|
||||
const isObject = typeof value === "object"
|
||||
const existing = existingObj[key]
|
||||
if (isObject && hasOverrides(value, existing || {})) {
|
||||
|
@ -29,8 +29,6 @@ async function parseSchemaUI(ctx: Ctx, view: CreateViewRequest) {
|
|||
return true
|
||||
}
|
||||
})
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
const table = await sdk.tables.getTable(view.tableId)
|
||||
|
@ -47,8 +45,7 @@ async function parseSchemaUI(ctx: Ctx, view: CreateViewRequest) {
|
|||
}
|
||||
}
|
||||
|
||||
const schemaUI =
|
||||
view.schema &&
|
||||
return view.schema &&
|
||||
Object.entries(view.schema).reduce((p, [fieldName, schemaValue]) => {
|
||||
const fieldSchema: RequiredKeys<UIFieldMetadata> = {
|
||||
order: schemaValue.order,
|
||||
|
@ -64,7 +61,6 @@ async function parseSchemaUI(ctx: Ctx, view: CreateViewRequest) {
|
|||
p[fieldName] = fieldSchema
|
||||
return p
|
||||
}, {} as Record<string, RequiredKeys<UIFieldMetadata>>)
|
||||
return schemaUI
|
||||
}
|
||||
|
||||
export async function create(ctx: Ctx<CreateViewRequest, ViewResponse>) {
|
||||
|
|
Loading…
Reference in New Issue