diff options
Diffstat (limited to 'app/Controllers/Http/Api')
-rw-r--r-- | app/Controllers/Http/Api/Static/AnnouncementsController.ts | 18 | ||||
-rw-r--r-- | app/Controllers/Http/Api/Static/EmptyController.ts | 4 | ||||
-rw-r--r-- | app/Controllers/Http/Api/Static/FeaturesController.ts | 4 |
3 files changed, 15 insertions, 11 deletions
diff --git a/app/Controllers/Http/Api/Static/AnnouncementsController.ts b/app/Controllers/Http/Api/Static/AnnouncementsController.ts index 4ae9d0e..090ee1c 100644 --- a/app/Controllers/Http/Api/Static/AnnouncementsController.ts +++ b/app/Controllers/Http/Api/Static/AnnouncementsController.ts | |||
@@ -1,16 +1,20 @@ | |||
1 | import type { HttpContext } from '@adonisjs/core/http' | 1 | import type { HttpContext } from '@adonisjs/core/http'; |
2 | import { app } from '@adonisjs/core/services/app' | 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 }: HttpContext) { | 7 | public async show({ response, params }: HttpContext) { |
8 | const announcement = path.join(app.resourcesPath(), 'announcements', `${params.version}.json`) | 8 | const announcement = path.join( |
9 | app.resourcesPath(), | ||
10 | 'announcements', | ||
11 | `${params.version}.json`, | ||
12 | ); | ||
9 | 13 | ||
10 | if (await fs.pathExists(announcement)) { | 14 | if (await fs.pathExists(announcement)) { |
11 | return response.download(announcement) | 15 | return response.download(announcement); |
12 | } | 16 | } |
13 | 17 | ||
14 | return response.status(404).send('No announcement found.') | 18 | return response.status(404).send('No announcement found.'); |
15 | } | 19 | } |
16 | } | 20 | } |
diff --git a/app/Controllers/Http/Api/Static/EmptyController.ts b/app/Controllers/Http/Api/Static/EmptyController.ts index ff05b1c..80d70b7 100644 --- a/app/Controllers/Http/Api/Static/EmptyController.ts +++ b/app/Controllers/Http/Api/Static/EmptyController.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import type { HttpContext } from '@adonisjs/core/http' | 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 }: HttpContext) { | 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 9e14c10..ce964de 100644 --- a/app/Controllers/Http/Api/Static/FeaturesController.ts +++ b/app/Controllers/Http/Api/Static/FeaturesController.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import type { HttpContext } from '@adonisjs/core/http' | 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 }: HttpContext) { | 4 | public async show({ response }: HttpContext) { |
@@ -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 | } |