diff options
Diffstat (limited to 'src/internal-server/app/Controllers/Http')
3 files changed, 13 insertions, 15 deletions
diff --git a/src/internal-server/app/Controllers/Http/RecipeController.js b/src/internal-server/app/Controllers/Http/RecipeController.js index eac34aa5c..61fa6be8f 100644 --- a/src/internal-server/app/Controllers/Http/RecipeController.js +++ b/src/internal-server/app/Controllers/Http/RecipeController.js | |||
@@ -4,7 +4,9 @@ const { validateAll } = use('Validator'); | |||
4 | const Env = use('Env'); | 4 | const Env = use('Env'); |
5 | 5 | ||
6 | const fetch = require('node-fetch'); | 6 | const fetch = require('node-fetch'); |
7 | const debug = require('../../../../preload-safe-debug')('Ferdium:internalServer:RecipeController'); | 7 | const debug = require('../../../../preload-safe-debug')( |
8 | 'Ferdium:internalServer:RecipeController', | ||
9 | ); | ||
8 | const { LIVE_FERDIUM_API } = require('../../../../config'); | 10 | const { LIVE_FERDIUM_API } = require('../../../../config'); |
9 | const { convertToJSON } = require('../../../../jsUtils'); | 11 | const { convertToJSON } = require('../../../../jsUtils'); |
10 | const { API_VERSION } = require('../../../../environment-remote'); | 12 | const { API_VERSION } = require('../../../../environment-remote'); |
@@ -87,15 +89,11 @@ class RecipeController { | |||
87 | } | 89 | } |
88 | 90 | ||
89 | // Return an empty array | 91 | // Return an empty array |
90 | update({ | 92 | update({ response }) { |
91 | response, | ||
92 | }) { | ||
93 | return response.send([]); | 93 | return response.send([]); |
94 | } | 94 | } |
95 | 95 | ||
96 | async popularRecipes({ | 96 | async popularRecipes({ response }) { |
97 | response, | ||
98 | }) { | ||
99 | const recipesUrlFetch = await fetch(`${RECIPES_URL}/popular`); | 97 | const recipesUrlFetch = await fetch(`${RECIPES_URL}/popular`); |
100 | const featuredRecipes = convertToJSON(await recipesUrlFetch.text()); | 98 | const featuredRecipes = convertToJSON(await recipesUrlFetch.text()); |
101 | return response.send(featuredRecipes); | 99 | return response.send(featuredRecipes); |
diff --git a/src/internal-server/app/Controllers/Http/ServiceController.js b/src/internal-server/app/Controllers/Http/ServiceController.js index 44e4a7369..226adb134 100644 --- a/src/internal-server/app/Controllers/Http/ServiceController.js +++ b/src/internal-server/app/Controllers/Http/ServiceController.js | |||
@@ -2,7 +2,10 @@ const Service = use('App/Models/Service'); | |||
2 | const { validateAll } = use('Validator'); | 2 | const { validateAll } = use('Validator'); |
3 | 3 | ||
4 | const { v4: uuid } = require('uuid'); | 4 | const { v4: uuid } = require('uuid'); |
5 | const { DEFAULT_SERVICE_ORDER, DEFAULT_SERVICE_SETTINGS } = require('../../../../config'); | 5 | const { |
6 | DEFAULT_SERVICE_ORDER, | ||
7 | DEFAULT_SERVICE_SETTINGS, | ||
8 | } = require('../../../../config'); | ||
6 | const { convertToJSON } = require('../../../../jsUtils'); | 9 | const { convertToJSON } = require('../../../../jsUtils'); |
7 | const { deduceIconUrl, moveIcon } = require('../../ImageHelper'); | 10 | const { deduceIconUrl, moveIcon } = require('../../ImageHelper'); |
8 | 11 | ||
@@ -30,7 +33,8 @@ class ServiceController { | |||
30 | serviceId = uuid(); | 33 | serviceId = uuid(); |
31 | } while ( | 34 | } while ( |
32 | // eslint-disable-next-line no-await-in-loop, unicorn/no-await-expression-member | 35 | // eslint-disable-next-line no-await-in-loop, unicorn/no-await-expression-member |
33 | (await Service.query().where('serviceId', serviceId).fetch()).rows.length > 0 | 36 | (await Service.query().where('serviceId', serviceId).fetch()).rows |
37 | .length > 0 | ||
34 | ); | 38 | ); |
35 | 39 | ||
36 | await Service.create({ | 40 | await Service.create({ |
diff --git a/src/internal-server/app/Controllers/Http/StaticController.js b/src/internal-server/app/Controllers/Http/StaticController.js index ac6f89008..0a0146d6b 100644 --- a/src/internal-server/app/Controllers/Http/StaticController.js +++ b/src/internal-server/app/Controllers/Http/StaticController.js | |||
@@ -4,9 +4,7 @@ | |||
4 | 4 | ||
5 | class StaticController { | 5 | class StaticController { |
6 | // Enable all features | 6 | // Enable all features |
7 | features({ | 7 | features({ response }) { |
8 | response, | ||
9 | }) { | ||
10 | return response.send({ | 8 | return response.send({ |
11 | isServiceProxyEnabled: true, | 9 | isServiceProxyEnabled: true, |
12 | isWorkspaceEnabled: true, | 10 | isWorkspaceEnabled: true, |
@@ -20,9 +18,7 @@ class StaticController { | |||
20 | } | 18 | } |
21 | 19 | ||
22 | // Show announcements | 20 | // Show announcements |
23 | announcement({ | 21 | announcement({ response }) { |
24 | response, | ||
25 | }) { | ||
26 | return response.send({}); | 22 | return response.send({}); |
27 | } | 23 | } |
28 | } | 24 | } |