diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index a95cd23b..0a4f3fa2 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -39,7 +39,7 @@ class Kernel extends HttpKernel ], 'api' => [ - 'throttle:60,1', + // 'throttle:60,1', 'bindings', ], ]; diff --git a/resources/assets/js/pages/settings/admin-supplier.vue b/resources/assets/js/pages/settings/admin-supplier.vue index 6bd7d6a8..28c00bac 100644 --- a/resources/assets/js/pages/settings/admin-supplier.vue +++ b/resources/assets/js/pages/settings/admin-supplier.vue @@ -10,7 +10,7 @@
@@ -77,29 +77,29 @@ var client = require('./client'); data() { return { tableData: [], - AddNewSupplierdialogVisible: false, - EditSupplierdialogVisible: false, - DoneAddSupplierdialogVisible: false, - DoneUpdateSupplierdialogVisible: false, - DeleteSupplierdialogVisible: false, supplierForm : { company_name: '', supplier_reg_no: '', gst_no: '', bank_name: '', acc_no: '', - } + }, + AddNewSupplierdialogVisible: false, + EditSupplierdialogVisible: false, + DoneAddSupplierdialogVisible: false, + DoneUpdateSupplierdialogVisible: false, + DeleteSupplierdialogVisible: false, } }, beforeMount(){ - this.GetTableData(); + this.UpdateTableData(); }, methods:{ CreateSupplier : function(){ this.DoneAddSupplierdialogVisible = false; client.post('api/setting-supplier', this.supplierForm) .then((response) => { - // anything + this.ClearSupplierForm(); }) .catch((error) => { console.log(error); @@ -111,21 +111,45 @@ var client = require('./client'); }); }) }, - GetTableData : function(){ + UpdateTableData : function(){ client.get('api/setting-supplier', this.supplierForm) - .then((response) => { - this.tableData = response.data; - }) - .catch((error) => { - console.log(error); - this.$message({ - showClose: true, - message: 'Fetch data fail', - type: 'error', - duration: 10000 - }); - }) + .then((response) => { + this.tableData = response.data; + this.UpdateTableData(); + }) + .catch((error) => { + console.log(error); + this.$message({ + showClose: true, + message: 'Fetch data fail', + type: 'error', + duration: 10000 + }); + }) + }, + DeleteSupplier : function(supplier_id){ + this.DeleteSupplierdialogVisible = true; + client.delete('api/setting-supplier/' + supplier_id) + .then((response) => { + this.UpdateTableData(); + }) + .catch((error) => { + console.log(error); + this.$message({ + showClose: true, + message: 'Delete data fail', + type: 'error', + duration: 10000 + }); + }) + }, + ClearSupplierForm : function(){ + supplierForm.company_name = ''; + supplierForm.supplier_reg_no = ''; + supplierForm.gst_no = ''; + supplierForm.bank_name = ''; + supplierForm.companacc_noy_name = ''; } } } - \ No newline at end of file +