From dd4ea6f488a34deedb22e8b04c7474e3277c05a9 Mon Sep 17 00:00:00 2001 From: Yannick Bungers Date: Sat, 11 Apr 2020 16:08:40 +0200 Subject: [PATCH] Added Types to actions.js and reformat Added Types to actions.js and reformat Readded csp.ts Signed-off-by: Yannick Bungers Signed-off-by: David Mehren --- lib/{csp.js => csp.ts} | 0 lib/response.ts | 1 + lib/web/note/actions.ts | 14 +++++--------- 3 files changed, 6 insertions(+), 9 deletions(-) rename lib/{csp.js => csp.ts} (100%) 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