mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-19 01:35:18 -04:00
moved response.js to response.ts and readded missing return statements
Signed-off-by: Yannick Bungers <git@innay.de> Signed-off-by: David Mehren <dmehren1@gmail.com>
This commit is contained in:
parent
bb8fb93fee
commit
536c54ff0d
3 changed files with 121 additions and 101 deletions
|
@ -51,9 +51,11 @@ export function getRevision (req: any, res: Response, note: Note): void {
|
|||
if (err) {
|
||||
logger.error(err)
|
||||
errors.errorInternalError(res)
|
||||
return
|
||||
}
|
||||
if (!content) {
|
||||
errors.errorNotFound(res)
|
||||
return
|
||||
}
|
||||
res.set({
|
||||
'Access-Control-Allow-Origin': '*', // allow CORS as API
|
||||
|
@ -66,12 +68,14 @@ export function getRevision (req: any, res: Response, note: Note): void {
|
|||
})
|
||||
} else {
|
||||
errors.errorNotFound(res)
|
||||
return
|
||||
}
|
||||
} else {
|
||||
Revision.getNoteRevisions(note, function (err, data) {
|
||||
if (err) {
|
||||
logger.error(err)
|
||||
errors.errorInternalError(res)
|
||||
return
|
||||
}
|
||||
const out = {
|
||||
revision: data
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue