Skip to content

Commit

Permalink
alphabetically sort categories and remove some logging
Browse files Browse the repository at this point in the history
  • Loading branch information
dulvui committed Nov 2, 2023
1 parent 3a2af43 commit 9224ee3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/main/webapp/view-events.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down Expand Up @@ -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`
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 9224ee3

Please sign in to comment.