Remove item from page if state changed by user

This commit is contained in:
Marvin Scholz 2017-01-20 03:07:28 +01:00
parent 9e37f644c3
commit 7bf1cd4086

View file

@ -26,6 +26,10 @@ var app = new Vue({
req.open("POST", "/admin/approve/" + id);
req.send();
this.showModal = false;
var index = this.items.indexOf(this.currentItem);
if (index > -1) {
this.items.splice(index, 1);
}
},
rejectItem: function (id) {
var req = new XMLHttpRequest();
@ -35,6 +39,10 @@ var app = new Vue({
req.open("POST", "/admin/reject/" + id);
req.send();
this.showModal = false;
var index = this.items.indexOf(this.currentItem);
if (index > -1) {
this.items.splice(index, 1);
}
}
}
})