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 { config } from './config'
|
||||||
import { Note, User } from './models'
|
import { Note, User } from './models'
|
||||||
|
|
||||||
|
|
|
@ -53,11 +53,9 @@ export function getRevision (req: any, res: Response, note: Note): void {
|
||||||
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
|
||||||
|
|
Loading…
Reference in a new issue