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