This commit is contained in:
Martin McKeaveney 2020-06-25 18:32:51 +01:00
parent 2a5d8cebd0
commit 92beb8ffa4
2 changed files with 5 additions and 11 deletions

View File

@ -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

View File

@ -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,
},
})