Remove item from page if state changed by user
This commit is contained in:
parent
9e37f644c3
commit
7bf1cd4086
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue