diff options
author | 2022-05-10 20:27:03 -0500 | |
---|---|---|
committer | 2022-05-11 01:27:03 +0000 | |
commit | bbecd8fdb673b64e3b2e2290dd990fe636acec38 (patch) | |
tree | 04fc63b32db0d4a8bfe9c62bf2426dea1115b719 | |
parent | Update submodules, browserslist data updates and linter fixes [skip ci] (diff) | |
download | ferdium-app-bbecd8fdb673b64e3b2e2290dd990fe636acec38.tar.gz ferdium-app-bbecd8fdb673b64e3b2e2290dd990fe636acec38.tar.zst ferdium-app-bbecd8fdb673b64e3b2e2290dd990fe636acec38.zip |
Revert "Eventually get remote recipes updates in internal server" (#134)
This reverts commit 1101eb3801fb265221baee91428ba1c9a19f6150.
-rw-r--r-- | src/internal-server/app/Controllers/Http/RecipeController.js | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/src/internal-server/app/Controllers/Http/RecipeController.js b/src/internal-server/app/Controllers/Http/RecipeController.js index 5f7c32d70..e88a89a0b 100644 --- a/src/internal-server/app/Controllers/Http/RecipeController.js +++ b/src/internal-server/app/Controllers/Http/RecipeController.js | |||
@@ -85,17 +85,10 @@ class RecipeController { | |||
85 | return response.send(results); | 85 | return response.send(results); |
86 | } | 86 | } |
87 | 87 | ||
88 | async update({ request, response }) { | 88 | // Return an empty array |
89 | // eslint-disable-next-line eqeqeq | 89 | update({ |
90 | if (Env.get('CONNECT_WITH_FRANZ') == 'true') { | 90 | response, |
91 | const body = request.all(); | 91 | }) { |
92 | const remoteUpdates = await fetch(`${RECIPES_URL}/update`, { | ||
93 | method: 'POST', | ||
94 | body: JSON.stringify(body), | ||
95 | headers: {'Content-Type': 'application/json'} | ||
96 | }); | ||
97 | return response.send(await remoteUpdates.json()); | ||
98 | } | ||
99 | return response.send([]); | 92 | return response.send([]); |
100 | } | 93 | } |
101 | 94 | ||
@@ -123,18 +116,19 @@ class RecipeController { | |||
123 | 116 | ||
124 | const service = params.recipe; | 117 | const service = params.recipe; |
125 | 118 | ||
126 | // eslint-disable-next-line eqeqeq | ||
127 | if (Env.get('CONNECT_WITH_FRANZ') == 'true') { | ||
128 | return response.redirect(`${RECIPES_URL}/download/${service}`); | ||
129 | } | ||
130 | // Check for invalid characters | 119 | // Check for invalid characters |
131 | if (/\.+/.test(service) || /\/+/.test(service)) { | 120 | if (/\.+/.test(service) || /\/+/.test(service)) { |
132 | return response.send('Invalid recipe name'); | 121 | return response.send('Invalid recipe name'); |
133 | } | 122 | } |
123 | |||
134 | // Check if recipe exists in recipes folder | 124 | // Check if recipe exists in recipes folder |
135 | if (await Drive.exists(`${service}.tar.gz`)) { | 125 | if (await Drive.exists(`${service}.tar.gz`)) { |
136 | return response.send(await Drive.get(`${service}.tar.gz`)); | 126 | return response.send(await Drive.get(`${service}.tar.gz`)); |
137 | } | 127 | } |
128 | // eslint-disable-next-line eqeqeq | ||
129 | if (Env.get('CONNECT_WITH_FRANZ') == 'true') { | ||
130 | return response.redirect(`${RECIPES_URL}/download/${service}`); | ||
131 | } | ||
138 | return response.status(400).send({ | 132 | return response.status(400).send({ |
139 | message: 'Recipe not found', | 133 | message: 'Recipe not found', |
140 | code: 'recipe-not-found', | 134 | code: 'recipe-not-found', |