diff options
author | MCMXC <16797721+mcmxcdev@users.noreply.github.com> | 2023-12-22 15:12:16 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-22 15:12:16 -0700 |
commit | 85927dc191a935761b3f175bcd50e7c3076acc9e (patch) | |
tree | ceeb350621d824eeb9fdc9137a64a2e820b269b9 /src/api/server/ServerApi.ts | |
parent | Reset nightly version to 6.7.1-nightly.0 (diff) | |
download | ferdium-app-85927dc191a935761b3f175bcd50e7c3076acc9e.tar.gz ferdium-app-85927dc191a935761b3f175bcd50e7c3076acc9e.tar.zst ferdium-app-85927dc191a935761b3f175bcd50e7c3076acc9e.zip |
refactor: remove unused code with knip (#1492)
- remove unused code snippets flagged by `npx knip`
Diffstat (limited to 'src/api/server/ServerApi.ts')
-rw-r--r-- | src/api/server/ServerApi.ts | 36 |
1 files changed, 1 insertions, 35 deletions
diff --git a/src/api/server/ServerApi.ts b/src/api/server/ServerApi.ts index 1530dd478..9e7582e1e 100644 --- a/src/api/server/ServerApi.ts +++ b/src/api/server/ServerApi.ts | |||
@@ -22,7 +22,7 @@ import UserModel from '../../models/User'; | |||
22 | import sleep from '../../helpers/async-helpers'; | 22 | import sleep from '../../helpers/async-helpers'; |
23 | 23 | ||
24 | import { SERVER_NOT_LOADED } from '../../config'; | 24 | import { SERVER_NOT_LOADED } from '../../config'; |
25 | import { userDataRecipesPath, userDataPath } from '../../environment-remote'; | 25 | import { userDataRecipesPath } from '../../environment-remote'; |
26 | import { asarRecipesPath } from '../../helpers/asar-helpers'; | 26 | import { asarRecipesPath } from '../../helpers/asar-helpers'; |
27 | import apiBase from '../apiBase'; | 27 | import apiBase from '../apiBase'; |
28 | import { | 28 | import { |
@@ -500,40 +500,6 @@ export default class ServerApi { | |||
500 | debug('ServerApi::healthCheck resolves'); | 500 | debug('ServerApi::healthCheck resolves'); |
501 | } | 501 | } |
502 | 502 | ||
503 | async getLegacyServices() { | ||
504 | const file = userDataPath('settings', 'services.json'); | ||
505 | |||
506 | try { | ||
507 | const config = readJsonSync(file); | ||
508 | |||
509 | if (Object.hasOwn(config, 'services')) { | ||
510 | const services = await Promise.all( | ||
511 | config.services.map(async (s: { service: any }) => { | ||
512 | const service = s; | ||
513 | const request = await sendAuthRequest( | ||
514 | `${apiBase()}/recipes/${s.service}`, | ||
515 | ); | ||
516 | |||
517 | if (request.status === 200) { | ||
518 | const data = await request.json(); | ||
519 | // @ts-expect-error Property 'recipe' does not exist on type '{ service: any; }'. | ||
520 | service.recipe = new RecipePreviewModel(data); | ||
521 | } | ||
522 | |||
523 | return service; | ||
524 | }), | ||
525 | ); | ||
526 | |||
527 | debug('ServerApi::getLegacyServices resolves', services); | ||
528 | return services; | ||
529 | } | ||
530 | } catch { | ||
531 | console.error('ServerApi::getLegacyServices no config found'); | ||
532 | } | ||
533 | |||
534 | return []; | ||
535 | } | ||
536 | |||
537 | // Helper | 503 | // Helper |
538 | async _mapServiceModels(services: any[]) { | 504 | async _mapServiceModels(services: any[]) { |
539 | const recipes = services.map((s: { recipeId: string }) => s.recipeId); | 505 | const recipes = services.map((s: { recipeId: string }) => s.recipeId); |