From f86739b020fec9bd88e3396eabd0e684fc6642c5 Mon Sep 17 00:00:00 2001 From: Chris Chase Date: Tue, 24 Feb 2026 16:17:29 +1030 Subject: [PATCH] orderby added to config and download --- odbcwritenow.html | 7 ++++++- odbcwritenow.js | 10 +++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/odbcwritenow.html b/odbcwritenow.html index 0a61d5f..b8074e6 100644 --- a/odbcwritenow.html +++ b/odbcwritenow.html @@ -5,7 +5,8 @@ defaults: { name: {value:""}, apikey: {value:""}, - what: {value:""} + what: {value:""}, + orderby: {value:""} }, inputs: 1, outputs: 2, @@ -25,6 +26,10 @@ +
+ + +
diff --git a/odbcwritenow.js b/odbcwritenow.js index deb5485..35fff51 100644 --- a/odbcwritenow.js +++ b/odbcwritenow.js @@ -54,11 +54,15 @@ module.exports = function(RED) { const page = parseInt(encodeURIComponent(msg.page || 0)); const apikey = encodeURIComponent(msg.apikey || config.apikey); const what = encodeURIComponent(config.what) + const orderby = encodeURIComponent(msg.orderby || config.orderby); + + msg.page = page msg.what = what msg.retry = 0 + var orderbystr = ""; var filtersstr = ""; const filters = encodeURIComponent(msg.filters || "") if (filters.length > 0) { @@ -75,7 +79,11 @@ module.exports = function(RED) { filtersstr += `&dateto=${dateto}` } - const url = `https://myobsync.accede.com.au/download/${what}/json/${page}?apikey=${apikey}${filtersstr}`; + if (orderby.length > 0) { + orderbystr += `&orderby=${orderby}` + } + + const url = `https://myobsync.accede.com.au/download/${what}/json/${page}?apikey=${apikey}${filtersstr}${orderbystr}`; DoImport(msg, url, node) });