This PR's main purpose is upgrading Search API to run on Node v18, in preparation for 16 going end of life in September 2023. Additionally, I made a few other changes for quality of life and refactoring out dependencies that are no longer maintained:
I moved all of the application code into a new src folder to make searching and linting configuration easier.
I refactored our use of promises and callbacks to instead use async/await. Note that I did not do that for the city-map-alteration and city-map-street-search helpers. See note below for details on why I left those helpers as-is
I fixed the waterfront-park-name helper so that the query matches the schema of the table. This fix also requires a small change where that helper is used in the Waterfront Access Map app because of a column name change. I'll open a PR for that to be released alongside these changes.
I added error handling to helpers and the controllers with try/catch so that helpers don't "fail silently" and return empty arrays.
Updated to a modern version of Eslint and fixed code where necessary to pass linting
Note about city-map-alteration and city-map-street-search helpers
In the process of trying to refactor these helpers, I realized that they have not been working because the column names in the query don't exist in the table it is querying. These helpers are only used in Streets, so I'll make another PR there to disable them. It looks like the table being queried was changed in this PR but it's not clear if these queries worked when that change was first made. In any case, we will have to investigate to get these helpers working again.
This PR's main purpose is upgrading Search API to run on Node v18, in preparation for 16 going end of life in September 2023. Additionally, I made a few other changes for quality of life and refactoring out dependencies that are no longer maintained:
request
has been moved to "maintenance mode", I removed our dependency on that in favor of Axios for making HTTP callssrc
folder to make searching and linting configuration easier.try/catch
so that helpers don't "fail silently" and return empty arrays.Note about
city-map-alteration
andcity-map-street-search
helpersIn the process of trying to refactor these helpers, I realized that they have not been working because the column names in the query don't exist in the table it is querying. These helpers are only used in Streets, so I'll make another PR there to disable them. It looks like the table being queried was changed in this PR but it's not clear if these queries worked when that change was first made. In any case, we will have to investigate to get these helpers working again.