X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fcontrollers%2Fapi%2Fcustom-page.ts;h=c19f03c560a40238dcea06e3e594cb9f30e5077b;hb=12edc1495a36b2199f1bf1ba37f50c7b694be382;hp=3c47f7b9af6fef11cb26d7f5abbf1518f88f27ef;hpb=8f608a4cb22ab232cfab20665050764b38bac9c7;p=github%2FChocobozzz%2FPeerTube.git 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 { 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() }