merge
This commit is contained in:
parent
2a5d8cebd0
commit
92beb8ffa4
|
@ -80,13 +80,11 @@ export const getBackendUiStore = () => {
|
|||
state.draftModel.schema = {}
|
||||
}
|
||||
|
||||
const id = uuid()
|
||||
|
||||
state.draftModel.schema = {
|
||||
...state.draftModel.schema,
|
||||
[id]: field,
|
||||
[field.name]: field,
|
||||
}
|
||||
state.selectedField = id
|
||||
state.selectedField = field.name
|
||||
state.tabs.NAVIGATION_PANEL = "NAVIGATE"
|
||||
|
||||
return state
|
||||
|
|
|
@ -12,16 +12,12 @@
|
|||
function createModel(model) {
|
||||
const { schema, ...rest } = $backendUiStore.selectedModel
|
||||
|
||||
const newModel = { ...model, schema: {} }
|
||||
|
||||
// TODO: could be better
|
||||
for (let key in model.schema) {
|
||||
newModel.schema[uuid()] = model.schema[key]
|
||||
}
|
||||
// const newModel = { ...model, schema: {} }
|
||||
|
||||
backendUiStore.actions.models.save({
|
||||
model: {
|
||||
...newModel,
|
||||
...model,
|
||||
schema: {},
|
||||
...rest,
|
||||
},
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue