diff --git a/lib/csp.js b/lib/csp.ts similarity index 100% rename from lib/csp.js rename to lib/csp.ts diff --git a/lib/response.ts b/lib/response.ts index bce5a31ba..49dde9abc 100644 --- a/lib/response.ts +++ b/lib/response.ts @@ -1,3 +1,4 @@ +'use strict' import { config } from './config' import { Note, User } from './models' diff --git a/lib/web/note/actions.ts b/lib/web/note/actions.ts index 2d6946aa8..391d52241 100644 --- a/lib/web/note/actions.ts +++ b/lib/web/note/actions.ts @@ -52,12 +52,10 @@ export function getRevision (req: any, res: Response, note: Note): void { logger.error(err) errors.errorInternalError(res) - return - } - if (!content) { + return + }if (!content) { errors.errorNotFound(res) - return - } + return} res.set({ 'Access-Control-Allow-Origin': '*', // allow CORS as API 'Access-Control-Allow-Headers': 'Range', @@ -68,15 +66,13 @@ export function getRevision (req: any, res: Response, note: Note): void { res.send(content) }) } else { - errors.errorNotFound(res) - return + errors.errorNotFound(res)return } } else { Revision.getNoteRevisions(note, function (err, data) { if (err) { logger.error(err) - errors.errorInternalError(res) - return + errors.errorInternalError(res)return } const out = { revision: data