Added Types to actions.js and reformat

Added Types to actions.js and reformat

Readded csp.ts

Signed-off-by: Yannick Bungers <git@innay.de>
Signed-off-by: David Mehren <dmehren1@gmail.com>
This commit is contained in:
Yannick Bungers 2020-04-11 16:08:40 +02:00 committed by David Mehren
parent 8b9c639e89
commit dd4ea6f488
No known key found for this signature in database
GPG key ID: 6017AF117F9756CB
3 changed files with 6 additions and 9 deletions

View file

@ -1,3 +1,4 @@
'use strict'
import { config } from './config' import { config } from './config'
import { Note, User } from './models' import { Note, User } from './models'

View file

@ -52,12 +52,10 @@ export function getRevision (req: any, res: Response, note: Note): void {
logger.error(err) logger.error(err)
errors.errorInternalError(res) errors.errorInternalError(res)
return return
} }if (!content) {
if (!content) {
errors.errorNotFound(res) errors.errorNotFound(res)
return return}
}
res.set({ res.set({
'Access-Control-Allow-Origin': '*', // allow CORS as API 'Access-Control-Allow-Origin': '*', // allow CORS as API
'Access-Control-Allow-Headers': 'Range', 'Access-Control-Allow-Headers': 'Range',
@ -68,15 +66,13 @@ export function getRevision (req: any, res: Response, note: Note): void {
res.send(content) res.send(content)
}) })
} else { } else {
errors.errorNotFound(res) errors.errorNotFound(res)return
return
} }
} else { } else {
Revision.getNoteRevisions(note, function (err, data) { Revision.getNoteRevisions(note, function (err, data) {
if (err) { if (err) {
logger.error(err) logger.error(err)
errors.errorInternalError(res) errors.errorInternalError(res)return
return
} }
const out = { const out = {
revision: data revision: data