mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-27 12:08:02 -05:00
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:
parent
8b9c639e89
commit
dd4ea6f488
3 changed files with 6 additions and 9 deletions
|
@ -1,3 +1,4 @@
|
|||
'use strict'
|
||||
import { config } from './config'
|
||||
import { Note, User } from './models'
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue