diff --git a/packages/nc-gui/components/project/spreadsheet/views/formView.vue b/packages/nc-gui/components/project/spreadsheet/views/formView.vue index 295d5a1e53..10452a72f0 100644 --- a/packages/nc-gui/components/project/spreadsheet/views/formView.vue +++ b/packages/nc-gui/components/project/spreadsheet/views/formView.vue @@ -575,13 +575,15 @@ export default { get() { return this.fields.filter(f => !f.show && !this.systemFieldsIds.includes(f.fk_column_id)) }, - set(v) {} + set(v) { + } }, columns: { get() { return this.fields.filter(f => f.show).sort((a, b) => a.order - b.order) }, - set(v) {} + set(v) { + } } }, watch: { @@ -850,18 +852,16 @@ export default { } this.loading = true - // const id = this.meta.columns.filter(c => c.pk).map(c => this.localState[c.title]).join('___') - - // const updatedObj = Object.keys(this.changedColumns).reduce((obj, col) => { - // obj[col] = this.localState[col] - // return obj - // }, {}) - - // if (this.isNew) { // todo: add params option in GraphQL // let data = await this.api.insert(this.localState, { params: { form: this.$route.query.view } }) - let data = await this.$api.data.create(this.meta.id, this.localState, { query: { form: this.$route.query.view } }) + let data = await this.$api.dbTableRow.create( + 'noco', + this.projectName, + this.meta.title, + this.localState, + { query: { form: this.$route.query.view } } + ) data = { ...this.localState, ...data } // save hasmany and manytomany relations from local state diff --git a/packages/nocodb/src/lib/noco/meta/api/formViewColumnApis.ts b/packages/nocodb/src/lib/noco/meta/api/formViewColumnApis.ts index acf4d11442..879ef33f56 100644 --- a/packages/nocodb/src/lib/noco/meta/api/formViewColumnApis.ts +++ b/packages/nocodb/src/lib/noco/meta/api/formViewColumnApis.ts @@ -10,7 +10,7 @@ export async function columnUpdate(req: Request, res: Response) { const router = Router({ mergeParams: true }); router.patch( - '/api/v1/db/meta/forms/columns/:formViewColumnId', + '/api/v1/db/meta/form/columns/:formViewColumnId', ncMetaAclMw(columnUpdate, 'columnUpdate') ); export default router;