diff --git a/src/components/partials/TableBudget.vue b/src/components/partials/TableBudget.vue index 96f4ceb9500857f845509ff20664c994d7bfc86e..425a20e61d1966b42b490fb71c2caabb828682b0 100644 --- a/src/components/partials/TableBudget.vue +++ b/src/components/partials/TableBudget.vue @@ -174,11 +174,28 @@ export default { }, updateAdmin : function() { - alert(this.selected); + if(this.selected === 0) { + alert('pilihan tidak valid') + } + let fetchData = { + method: 'POST', + body: JSON.stringify({page_id : this.dataTable.current_item.id.$oid, admin_id: this.selected}), + headers: { "Content-Type": "application/json" } + } + + console.log(fetchData) + + fetch(`${this.$store.state.baseUrl}/api/admin/add-page`, fetchData) + .then(response => response.json()) + .then(response => { + if(response.status === 200) { + alert("berhasil"); + } + }) this.dataTable.current_item.admin_name = this.options[this.selected].text; }, seeDetail : function(row) { - this.isBusy = true + // this.isBusy = true this.$emit('changeActivity',row.item.id); }, showModal : function() {