aboutsummaryrefslogtreecommitdiffstats
path: root/src/internal-server/app/Controllers
diff options
context:
space:
mode:
authorLibravatar Vijay A <vraravam@users.noreply.github.com>2022-07-25 08:16:50 +0530
committerLibravatar Vijay A <vraravam@users.noreply.github.com>2022-07-25 08:17:10 +0530
commitcf282aa351cbc58691fb1b2fb4764830247cdbe8 (patch)
tree1a6ac4c9abd8b3de9d358016a5065da86cdd8510 /src/internal-server/app/Controllers
parent6.0.1-nightly.3 [skip ci] (diff)
downloadferdium-app-cf282aa351cbc58691fb1b2fb4764830247cdbe8.tar.gz
ferdium-app-cf282aa351cbc58691fb1b2fb4764830247cdbe8.tar.zst
ferdium-app-cf282aa351cbc58691fb1b2fb4764830247cdbe8.zip
eslint needs to be executed at the top-level to actually workv6.0.1-nightly.3
Diffstat (limited to 'src/internal-server/app/Controllers')
-rw-r--r--src/internal-server/app/Controllers/Http/RecipeController.js12
-rw-r--r--src/internal-server/app/Controllers/Http/ServiceController.js8
-rw-r--r--src/internal-server/app/Controllers/Http/StaticController.js8
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');
4const Env = use('Env'); 4const Env = use('Env');
5 5
6const fetch = require('node-fetch'); 6const fetch = require('node-fetch');
7const debug = require('../../../../preload-safe-debug')('Ferdium:internalServer:RecipeController'); 7const debug = require('../../../../preload-safe-debug')(
8 'Ferdium:internalServer:RecipeController',
9);
8const { LIVE_FERDIUM_API } = require('../../../../config'); 10const { LIVE_FERDIUM_API } = require('../../../../config');
9const { convertToJSON } = require('../../../../jsUtils'); 11const { convertToJSON } = require('../../../../jsUtils');
10const { API_VERSION } = require('../../../../environment-remote'); 12const { 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');
2const { validateAll } = use('Validator'); 2const { validateAll } = use('Validator');
3 3
4const { v4: uuid } = require('uuid'); 4const { v4: uuid } = require('uuid');
5const { DEFAULT_SERVICE_ORDER, DEFAULT_SERVICE_SETTINGS } = require('../../../../config'); 5const {
6 DEFAULT_SERVICE_ORDER,
7 DEFAULT_SERVICE_SETTINGS,
8} = require('../../../../config');
6const { convertToJSON } = require('../../../../jsUtils'); 9const { convertToJSON } = require('../../../../jsUtils');
7const { deduceIconUrl, moveIcon } = require('../../ImageHelper'); 10const { 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
5class StaticController { 5class 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}