|
|
@ -933,15 +933,18 @@ export default { |
|
|
|
if (!this.data[row]) { |
|
|
|
if (!this.data[row]) { |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
const { row: rowObj, rowMeta, oldRow } = this.data[row] |
|
|
|
const { row: rowObj, rowMeta, oldRow, saving } = this.data[row] |
|
|
|
if (rowMeta.new) { |
|
|
|
if (rowMeta.new) { |
|
|
|
|
|
|
|
// return if there is no change |
|
|
|
|
|
|
|
if (oldRow[column._cn] === rowObj[column._cn] || saving) { |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
await this.save() |
|
|
|
await this.save() |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
try { |
|
|
|
try { |
|
|
|
if (!this.api) { |
|
|
|
if (!this.api) { |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// return if there is no change |
|
|
|
// return if there is no change |
|
|
|
if (oldRow[column._cn] === rowObj[column._cn]) { |
|
|
|
if (oldRow[column._cn] === rowObj[column._cn]) { |
|
|
|
return |
|
|
|
return |
|
|
@ -953,7 +956,7 @@ export default { |
|
|
|
return this.$toast.info('Update not allowed for table which doesn\'t have primary Key').goAway(3000) |
|
|
|
return this.$toast.info('Update not allowed for table which doesn\'t have primary Key').goAway(3000) |
|
|
|
} |
|
|
|
} |
|
|
|
this.$set(this.data[row], 'saving', true) |
|
|
|
this.$set(this.data[row], 'saving', true) |
|
|
|
|
|
|
|
// eslint-disable-next-line promise/param-names |
|
|
|
const newData = await this.api.update(id, { |
|
|
|
const newData = await this.api.update(id, { |
|
|
|
[column._cn]: rowObj[column._cn] |
|
|
|
[column._cn]: rowObj[column._cn] |
|
|
|
}, { [column._cn]: oldRow[column._cn] }) |
|
|
|
}, { [column._cn]: oldRow[column._cn] }) |
|
|
|