From 2c6043670aa4f9788a968a568ee015cb3caa934e Mon Sep 17 00:00:00 2001 From: Cleopatra Enjeck M Date: Wed, 7 Feb 2024 12:49:25 +0100 Subject: [PATCH] enh: improve props Signed-off-by: Cleopatra Enjeck M --- src/modules/modals/DeleteRows.vue | 14 +++++++++++--- src/modules/modals/Modals.vue | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/modules/modals/DeleteRows.vue b/src/modules/modals/DeleteRows.vue index ed73e64b1..dbcb2d176 100644 --- a/src/modules/modals/DeleteRows.vue +++ b/src/modules/modals/DeleteRows.vue @@ -26,14 +26,22 @@ export default { type: Array, default: null, }, + elementId: { + type: Number, + default: null, + }, + isView: { + type: Boolean, + default: true, + }, }, methods: { deleteRows() { let error = false - this.rowsToDelete.rows.forEach(rowId => { + this.rowsToDelete.forEach(rowId => { const res = this.$store.dispatch('removeRow', { rowId, - viewId: this.rowsToDelete.isView ? this.rowsToDelete.elementId : null, + viewId: this.isView ? this.elementId : null, }) if (!res) { error = true @@ -42,7 +50,7 @@ export default { if (error) { showError(t('tables', 'Error occurred while deleting rows.')) } - emit('tables:selected-rows:deselect', { elementId: this.rowsToDelete.elementId, isView: this.rowsToDelete.isView }) + emit('tables:selected-rows:deselect', { elementId: this.elementId, isView: this.isView }) this.$emit('cancel') }, }, diff --git a/src/modules/modals/Modals.vue b/src/modules/modals/Modals.vue index 0e71629ab..aa1ab3629 100644 --- a/src/modules/modals/Modals.vue +++ b/src/modules/modals/Modals.vue @@ -19,7 +19,7 @@ :show-modal="editRow !== null" :out-transition="true" @close="editRow = null" /> - +