refactor(gui): code refactoring

Signed-off-by: Pranav C <pranavxc@gmail.com>
This commit is contained in:
Pranav C
2021-11-27 13:00:56 +05:30
parent 556f49d57d
commit 29a577d231
3 changed files with 10 additions and 10 deletions

View File

@@ -1040,14 +1040,14 @@ export default {
await this.api.delete(id)
}
this.data.splice(this.rowContextMenu.index, 1)
this.$toast.success('Deleted row successfully').goAway(3000)
// this.$toast.success('Deleted row successfully').goAway(3000)
} catch (e) {
this.$toast.error(`Failed to delete row : ${e.message}`).goAway(3000)
}
},
async deleteSelectedRows() {
let row = this.rowLength
let success = 0
// let success = 0
while (row--) {
try {
const { row: rowObj, rowMeta } = this.data[row]
@@ -1064,12 +1064,12 @@ export default {
await this.api.delete(id)
}
this.data.splice(row, 1)
success++
// success++
} catch (e) {
return this.$toast.error(`Failed to delete row : ${e.message}`).goAway(3000)
}
}
if (success) { this.$toast.success(`Deleted ${success} selected row${success > 1 ? 's' : ''} successfully`).goAway(3000) }
// if (success) { this.$toast.success(`Deleted ${success} selected row${success > 1 ? 's' : ''} successfully`).goAway(3000) }
},
async clearCellValue() {