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.open("POST", "/admin/approve/" + id);
|
||||||
req.send();
|
req.send();
|
||||||
this.showModal = false;
|
this.showModal = false;
|
||||||
|
var index = this.items.indexOf(this.currentItem);
|
||||||
|
if (index > -1) {
|
||||||
|
this.items.splice(index, 1);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
rejectItem: function (id) {
|
rejectItem: function (id) {
|
||||||
var req = new XMLHttpRequest();
|
var req = new XMLHttpRequest();
|
||||||
|
@ -35,6 +39,10 @@ var app = new Vue({
|
||||||
req.open("POST", "/admin/reject/" + id);
|
req.open("POST", "/admin/reject/" + id);
|
||||||
req.send();
|
req.send();
|
||||||
this.showModal = false;
|
this.showModal = false;
|
||||||
|
var index = this.items.indexOf(this.currentItem);
|
||||||
|
if (index > -1) {
|
||||||
|
this.items.splice(index, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue