From 03f13832061340fa7f209b87ca50bce0e4a50eca Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 13 Jan 2021 18:07:05 +0000 Subject: [PATCH] --- ayanova/src/components/pick-list.vue | 73 +++++++++++++++------------- 1 file changed, 39 insertions(+), 34 deletions(-) diff --git a/ayanova/src/components/pick-list.vue b/ayanova/src/components/pick-list.vue index f0daf591..5b1427a1 100644 --- a/ayanova/src/components/pick-list.vue +++ b/ayanova/src/components/pick-list.vue @@ -197,34 +197,19 @@ export default { window.$gz.form.addNoSelectionItem(vm.searchResults, true); } else { //Not here, better get it - let variantSegment = ""; + let pickListParams = { + ayaType: vm.ayaType, + preselectedIds: [vm.value] + }; + if (vm.variant != null) { - variantSegment = `&variant=${vm.variant}`; + pickListParams["listVariant"] = vm.variant; + //variantSegment = `&variant=${vm.variant}`; } - let urlParams = - "?ayaType=" + vm.ayaType + "&preId=" + vm.value + variantSegment; - /* - [FromBody] - public AyaType AyaType { get; set; } + // let pickListParams = + // "?ayaType=" + vm.ayaType + "&preId=" + vm.value + variantSegment; - [FromBody] - public string Query { get; set; } - - [FromBody] - public bool Inactive { get; set; } - - [FromBody] - public List PreselectedIds { get; set; } - - [FromBody] - public string ListVariant { get; set; } - - //"{\"ayaType\":8,\"preselectedIds\":[1,3,5,7]}" - } - - */ - - vm.getList(urlParams); + vm.getList(pickListParams); } }, replaceLastSelection() { @@ -286,24 +271,42 @@ export default { // } // } }, - getList: async function(urlParams) { + getList: async function(pickListParams) { + /* + public AyaType AyaType { get; set; } + public string Query { get; set; } + public bool Inactive { get; set; } + public List PreselectedIds { get; set; } + public string ListVariant { get; set; } + //"{\"ayaType\":8,\"preselectedIds\":[1,3,5,7]}" + } + + */ let vm = this; if (vm.fetching) { return; } vm.fetching = true; //default params for when called on init - if (!urlParams) { - urlParams = "?ayaType=" + vm.ayaType; + if (!pickListParams) { + pickListParams = { + ayaType: vm.ayaType, + preselectedIds: [vm.value] + }; + // urlParams = "?ayaType=" + vm.ayaType; if (vm.includeInactive) { - urlParams += "&inactive=true"; + pickListParams["inactive"] = true; + //urlParams += "&inactive=true"; } if (vm.variant != null) { - urlParams += `&variant=${vm.variant}`; + pickListParams["listVariant"] = vm.variant; + //urlParams += `&variant=${vm.variant}`; } } try { - let res = await window.$gz.api.get("pick-list/list" + urlParams); + let res = await window.$gz.api.upsert("pick-list/list", pickListParams); + + // let res = await window.$gz.api.get("pick-list/list" + urlParams); vm.fetching = false; //We never expect there to be no data here @@ -391,14 +394,16 @@ export default { } } - //build url - let urlParams = "?ayaType=" + vm.ayaType; + //build parameter + let pickListParams = { ayaType: vm.ayaType }; + //let urlParams = "?ayaType=" + vm.ayaType; if (!emptyQuery) { let query = queryTerms[0]; if (queryTerms[1] != "[?]") { query += " " + queryTerms[1]; } - urlParams += "&query=" + query; + //urlParams += "&query=" + query; + pickListParams["query"]=query; } if (vm.includeInactive) {