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 { Note, User } from './models'

View file

@ -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