Browse Source

refactor: data update api correction

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/1668/head
Pranav C 3 years ago
parent
commit
5683f4b4d2
  1. 15
      packages/nc-gui/components/project/spreadsheet/rowsXcDataTable.vue
  2. 4
      packages/nocodb/src/lib/noco/meta/api/dataApis/dataAliasApis.ts

15
packages/nc-gui/components/project/spreadsheet/rowsXcDataTable.vue

@ -1115,14 +1115,17 @@ export default {
this.$set(this.data[row], 'saving', true)
// eslint-disable-next-line promise/param-names
const newData = (await this.$api.data.update(this.meta.id, id, {
[column.title]: rowObj[column.title]
}, {
query: { ignoreWebhook: !saved }
}))// { [column.title]: oldRow[column.title] })
const newData = (await this.$api.dbTableRow.update(
'noco',
this.projectName,
this.meta.title, id, {
[column.title]: rowObj[column.title]
}, {
query: { ignoreWebhook: !saved }
}))
// audit
this.$api.utils.auditRowUpdate({
this.$api.utils.auditRowUpdate(id, {
fk_model_id: this.meta.id,
column_name: column.title,
row_id: id,

4
packages/nocodb/src/lib/noco/meta/api/dataApis/dataAliasApis.ts

@ -33,7 +33,7 @@ async function dataUpdate(req: Request, res: Response) {
const baseModel = await Model.getBaseModelSQL({
id: model.id,
viewId: view.id,
viewId: view?.id,
dbDriver: NcConnectionMgrv2.get(base)
});
@ -45,7 +45,7 @@ async function dataDelete(req: Request, res: Response) {
const base = await Base.get(model.base_id);
const baseModel = await Model.getBaseModelSQL({
id: model.id,
viewId: view.id,
viewId: view?.id,
dbDriver: NcConnectionMgrv2.get(base)
});

Loading…
Cancel
Save