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