|
|
|
@ -125,24 +125,11 @@ const [useProvideExpandedFormStore, useExpandedFormStore] = useInjectionState((m
|
|
|
|
|
if (row.value.rowMeta?.new) { |
|
|
|
|
data = await $api.dbTableRow.create('noco', project.value.title as string, meta.value.title, updateOrInsertObj) |
|
|
|
|
|
|
|
|
|
/* todo: |
|
|
|
|
// save hasmany and manytomany relations from local state
|
|
|
|
|
if (this.$refs.virtual && Array.isArray(this.$refs.virtual)) { |
|
|
|
|
for (const vcell of this.$refs.virtual) { |
|
|
|
|
if (vcell.save) { |
|
|
|
|
await vcell.save(this.localState); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} */ |
|
|
|
|
|
|
|
|
|
Object.assign(row.value, { |
|
|
|
|
row: data, |
|
|
|
|
rowMeta: {}, |
|
|
|
|
oldRow: { ...data }, |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
/// todo:
|
|
|
|
|
// await this.reload();
|
|
|
|
|
} else if (Object.keys(updateOrInsertObj).length) { |
|
|
|
|
const id = extractPkFromRow(row.value.row, meta.value.columns as ColumnType[]) |
|
|
|
|
|
|
|
|
@ -160,7 +147,12 @@ const [useProvideExpandedFormStore, useExpandedFormStore] = useInjectionState((m
|
|
|
|
|
value: getHTMLEncodedText(updateOrInsertObj[key]), |
|
|
|
|
prev_value: getHTMLEncodedText(row.value.oldRow[key]), |
|
|
|
|
}) |
|
|
|
|
.then(() => {}) |
|
|
|
|
.then(async () => { |
|
|
|
|
/** load latest comments/audit if right drawer is open*/ |
|
|
|
|
if (commentsDrawer.value) { |
|
|
|
|
await loadCommentsAndLogs() |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
return message.info('No columns to update') |
|
|
|
|