From 7e2706c69925a492b7ed39cad5f954c12bdd8f28 Mon Sep 17 00:00:00 2001 From: Alexis <35.alexis.pele@gmail.com> Date: Wed, 3 May 2023 17:05:59 +0200 Subject: [PATCH 1/3] Ignored .env file --- .env | 1 - .gitignore | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) delete mode 100644 .env diff --git a/.env b/.env deleted file mode 100644 index 9e8e7cf..0000000 --- a/.env +++ /dev/null @@ -1 +0,0 @@ -GOOGLE_API_KEY=AIzaSyAaVfXbFPUQSeif2FwY1gQ2iJaBp9ZPdPM \ No newline at end of file diff --git a/.gitignore b/.gitignore index 52962c2..f15f8f1 100644 --- a/.gitignore +++ b/.gitignore @@ -56,3 +56,5 @@ profile-* profile* *clinic* *flamegraph* + +.env From 8b515e1cf638fba6c742d926fbf544e74ed59932 Mon Sep 17 00:00:00 2001 From: Alexis <35.alexis.pele@gmail.com> Date: Thu, 4 May 2023 18:20:13 +0200 Subject: [PATCH 2/3] Added error check if countryName isn't recognized --- index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.js b/index.js index 1d05a2d..d42f8b6 100644 --- a/index.js +++ b/index.js @@ -81,6 +81,10 @@ app.use('/rep', async (req, res) => { } } + if (!circoForeign) { + throw new Error('Error trying to parse this country : ' + countryName) + } + // If a code is found, send the associated file containing the representant data const repFile = readFileSync(join(__dirname, `public/reps/${lookupTable[circoForeign]}.json`), 'utf-8') res.end(repFile) From fa4908f764008e5777f01807567f9739d7cc811d Mon Sep 17 00:00:00 2001 From: Alexis <35.alexis.pele@gmail.com> Date: Thu, 4 May 2023 18:20:21 +0200 Subject: [PATCH 3/3] Fixed some countryNames in lookup table --- rep-lookup-foreign.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rep-lookup-foreign.js b/rep-lookup-foreign.js index 391d093..cafca08 100644 --- a/rep-lookup-foreign.js +++ b/rep-lookup-foreign.js @@ -84,7 +84,7 @@ module.exports = { "Slovakia", ], "099-08": [ - "Italia", + "Italy", "Malta", "San Marino", "Holy See", @@ -147,7 +147,7 @@ module.exports = { "São Tomé and Príncipe", "Angola", "Congolese", - "Democratic Republic of Congo", + "Democratic Republic of the Congo", "Iraq", "Jordan", "Lebanon",