Update the delete component to work with the table components

parent d04bac5a
...@@ -5,10 +5,10 @@ ...@@ -5,10 +5,10 @@
<script> <script>
export default { export default {
props: { props: {
deleteAction: {default: null},
deleteMessage: {default: "Are you sure you want to delete this record?"}, deleteMessage: {default: "Are you sure you want to delete this record?"},
deleteTitle: {default: "Confirmation"}, deleteTitle: {default: "Confirmation"},
rowId: {default: null}, rows: {default: null},
scope: {default: null},
}, },
methods: { methods: {
deleteRow(event) { deleteRow(event) {
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
let vm = this; let vm = this;
axios.delete(this.deleteAction) axios.delete(this.scope.row.urls.delete_url)
.then(function (response) { .then(function (response) {
if (response.data.errors === false) { if (response.data.errors === false) {
vm.$message({ vm.$message({
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
message: response.data.message message: response.data.message
}); });
$('#' + vm.rowId).remove(); vm.rows.splice(vm.scope.$index, 1);
} }
}) })
.catch(function (error) { .catch(function (error) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment