From 1e0a4219ebad70f016e6c2dce6b0999b0e9128c3 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 3 Feb 2021 20:17:53 +0000 Subject: [PATCH] --- .../src/components/data-table-filter-control.vue | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/ayanova/src/components/data-table-filter-control.vue b/ayanova/src/components/data-table-filter-control.vue index 3628ca55..177d0ade 100644 --- a/ayanova/src/components/data-table-filter-control.vue +++ b/ayanova/src/components/data-table-filter-control.vue @@ -352,7 +352,7 @@ export default { activeFilterId: Number }, methods: { - saveAndExit() { + async saveAndExit() { //todo: save changes here //Note: we are working with a specific filter, either the "default" filter which is the one used when no other filter is specified or a specific one //So here we need to take the current filter, update it and save it @@ -374,7 +374,7 @@ export default { from server: activefilter:{ "id": 1, "concurrency": 5029293, "userId": 1, "name": "-", "public": false, "defaultFilter": true, "listKey": "TestWidgetDataList", "filter": "[]" } */ - console.log("BEFORE SAVE ACTIVE FILTER:", this.activeFilter); + // console.log("BEFORE SAVE ACTIVE FILTER:", this.activeFilter); //turn activeFilter into object json.parse let af = JSON.parse(this.activeFilter.filter); @@ -403,9 +403,13 @@ from server: activefilter:{ "id": 1, "concurrency": 5029293, "userId": 1, "name" this.activeFilter.filter = JSON.stringify(af); //SAVE - console.log("SAVE ACTIVE FILTER:", this.activeFilter); - - this.close({ refresh: true }); + let res = await window.$gz.api.put("data-list-filter", this.activeFilter); + if (res.error) { + //throw new Error(res.error); + throw new Error(window.$gz.errorHandler.errorToString(res, vm)); + } else { + this.close({ refresh: true }); + } }, addFilterCondition(editItem) { // filter:[{column:"PartPartNumber",any:true/false,items:[{op: "=",value: "400735"}]}],