]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/controllers/api/custom-page.ts
Introduce comments command
[github/Chocobozzz/PeerTube.git] / server / controllers / api / custom-page.ts
index 3c47f7b9af6fef11cb26d7f5abbf1518f88f27ef..c19f03c560a40238dcea06e3e594cb9f30e5077b 100644 (file)
@@ -27,7 +27,12 @@ export {
 
 async function getInstanceHomepage (req: express.Request, res: express.Response) {
   const page = await ActorCustomPageModel.loadInstanceHomepage()
-  if (!page) return res.sendStatus(HttpStatusCode.NOT_FOUND_404)
+  if (!page) {
+    return res.fail({
+      status: HttpStatusCode.NOT_FOUND_404,
+      message: 'Instance homepage could not be found'
+    })
+  }
 
   return res.json(page.toFormattedJSON())
 }
@@ -38,5 +43,5 @@ async function updateInstanceHomepage (req: express.Request, res: express.Respon
   await ActorCustomPageModel.updateInstanceHomepage(content)
   ServerConfigManager.Instance.updateHomepageState(content)
 
-  return res.sendStatus(HttpStatusCode.NO_CONTENT_204)
+  return res.status(HttpStatusCode.NO_CONTENT_204).end()
 }