diff options
Diffstat (limited to 'app/Controllers/Http/Api')
-rw-r--r-- | app/Controllers/Http/Api/Static/AnnouncementsController.ts | 20 | ||||
-rw-r--r-- | app/Controllers/Http/Api/Static/EmptyController.ts | 6 | ||||
-rw-r--r-- | app/Controllers/Http/Api/Static/FeaturesController.ts | 6 |
3 files changed, 14 insertions, 18 deletions
diff --git a/app/Controllers/Http/Api/Static/AnnouncementsController.ts b/app/Controllers/Http/Api/Static/AnnouncementsController.ts index c20707b..4ae9d0e 100644 --- a/app/Controllers/Http/Api/Static/AnnouncementsController.ts +++ b/app/Controllers/Http/Api/Static/AnnouncementsController.ts | |||
@@ -1,20 +1,16 @@ | |||
1 | import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'; | 1 | import type { HttpContext } from '@adonisjs/core/http' |
2 | import Application from '@ioc:Adonis/Core/Application'; | 2 | import { app } from '@adonisjs/core/services/app' |
3 | import path from 'node:path'; | 3 | import path from 'node:path' |
4 | import fs from 'fs-extra'; | 4 | import fs from 'fs-extra' |
5 | 5 | ||
6 | export default class AnnouncementsController { | 6 | export default class AnnouncementsController { |
7 | public async show({ response, params }: HttpContextContract) { | 7 | public async show({ response, params }: HttpContext) { |
8 | const announcement = path.join( | 8 | const announcement = path.join(app.resourcesPath(), 'announcements', `${params.version}.json`) |
9 | Application.resourcesPath(), | ||
10 | 'announcements', | ||
11 | `${params.version}.json`, | ||
12 | ); | ||
13 | 9 | ||
14 | if (await fs.pathExists(announcement)) { | 10 | if (await fs.pathExists(announcement)) { |
15 | return response.download(announcement); | 11 | return response.download(announcement) |
16 | } | 12 | } |
17 | 13 | ||
18 | return response.status(404).send('No announcement found.'); | 14 | return response.status(404).send('No announcement found.') |
19 | } | 15 | } |
20 | } | 16 | } |
diff --git a/app/Controllers/Http/Api/Static/EmptyController.ts b/app/Controllers/Http/Api/Static/EmptyController.ts index a07790e..ff05b1c 100644 --- a/app/Controllers/Http/Api/Static/EmptyController.ts +++ b/app/Controllers/Http/Api/Static/EmptyController.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'; | 1 | import type { HttpContext } from '@adonisjs/core/http' |
2 | 2 | ||
3 | export default class EmptyController { | 3 | export default class EmptyController { |
4 | public async show({ response }: HttpContextContract) { | 4 | public async show({ response }: HttpContext) { |
5 | return response.send([]); | 5 | return response.send([]) |
6 | } | 6 | } |
7 | } | 7 | } |
diff --git a/app/Controllers/Http/Api/Static/FeaturesController.ts b/app/Controllers/Http/Api/Static/FeaturesController.ts index d471b11..9e14c10 100644 --- a/app/Controllers/Http/Api/Static/FeaturesController.ts +++ b/app/Controllers/Http/Api/Static/FeaturesController.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'; | 1 | import type { HttpContext } from '@adonisjs/core/http' |
2 | 2 | ||
3 | export default class FeaturesController { | 3 | export default class FeaturesController { |
4 | public async show({ response }: HttpContextContract) { | 4 | public async show({ response }: HttpContext) { |
5 | return response.send({ | 5 | return response.send({ |
6 | isServiceProxyEnabled: true, | 6 | isServiceProxyEnabled: true, |
7 | isWorkspaceEnabled: true, | 7 | isWorkspaceEnabled: true, |
@@ -9,6 +9,6 @@ export default class FeaturesController { | |||
9 | isSettingsWSEnabled: false, | 9 | isSettingsWSEnabled: false, |
10 | isMagicBarEnabled: true, | 10 | isMagicBarEnabled: true, |
11 | isTodosEnabled: true, | 11 | isTodosEnabled: true, |
12 | }); | 12 | }) |
13 | } | 13 | } |
14 | } | 14 | } |