From 9224ee3f6e2c14b20ed3728ced6df18506b22be2 Mon Sep 17 00:00:00 2001 From: Simon Dalvai Date: Thu, 2 Nov 2023 15:18:59 +0100 Subject: [PATCH] alphabetically sort categories and remove some logging --- src/main/webapp/view-events.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/webapp/view-events.js b/src/main/webapp/view-events.js index 3bbacd0..1fd669b 100644 --- a/src/main/webapp/view-events.js +++ b/src/main/webapp/view-events.js @@ -93,6 +93,7 @@ const api_response = await fetchAuthorized(`${env.ODH_MOBILITY_API_URI}/flat,event/${provider}?select=evcategory&distinct=1`, AUTHORIZATION_TOKEN) const response_body = await api_response.json() const categories = response_body.data.map(c => c.evcategory) // clean up the data + categories.sort((a, b) => a.toLowerCase().localeCompare(b.toLowerCase())) // sort alphabetically if (categories) { addOption("All", "", _category, true) // add a catch-all fake category categories.forEach(c => { @@ -258,7 +259,7 @@ where_params.push(`evend.neq.null`); if (where_params.length == 0) { api_url += "?limit=-1" - } else if (where_params.length == 1){ + } else if (where_params.length == 1) { api_url = `${api_url}?where=${where_params[0]}&limit=-1` } else { api_url = `${api_url}?where=and(${where_params.join(',')})&limit=-1` @@ -300,8 +301,6 @@ } } } - console.debug("open end {}", _openEnd.checked); - console.debug("events {}", events.length); // feed the reactive-table webcomponent with the parsed data and its schema _table._schema = getTableSchema()