diff options
Diffstat (limited to 'server/controllers/api/custom-page.ts')
-rw-r--r-- | server/controllers/api/custom-page.ts | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/server/controllers/api/custom-page.ts b/server/controllers/api/custom-page.ts index 3c47f7b9a..c19f03c56 100644 --- a/server/controllers/api/custom-page.ts +++ b/server/controllers/api/custom-page.ts | |||
@@ -27,7 +27,12 @@ export { | |||
27 | 27 | ||
28 | async function getInstanceHomepage (req: express.Request, res: express.Response) { | 28 | async function getInstanceHomepage (req: express.Request, res: express.Response) { |
29 | const page = await ActorCustomPageModel.loadInstanceHomepage() | 29 | const page = await ActorCustomPageModel.loadInstanceHomepage() |
30 | if (!page) return res.sendStatus(HttpStatusCode.NOT_FOUND_404) | 30 | if (!page) { |
31 | return res.fail({ | ||
32 | status: HttpStatusCode.NOT_FOUND_404, | ||
33 | message: 'Instance homepage could not be found' | ||
34 | }) | ||
35 | } | ||
31 | 36 | ||
32 | return res.json(page.toFormattedJSON()) | 37 | return res.json(page.toFormattedJSON()) |
33 | } | 38 | } |
@@ -38,5 +43,5 @@ async function updateInstanceHomepage (req: express.Request, res: express.Respon | |||
38 | await ActorCustomPageModel.updateInstanceHomepage(content) | 43 | await ActorCustomPageModel.updateInstanceHomepage(content) |
39 | ServerConfigManager.Instance.updateHomepageState(content) | 44 | ServerConfigManager.Instance.updateHomepageState(content) |
40 | 45 | ||
41 | return res.sendStatus(HttpStatusCode.NO_CONTENT_204) | 46 | return res.status(HttpStatusCode.NO_CONTENT_204).end() |
42 | } | 47 | } |