mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 19:42:24 +02:00
Refactor server errors handler
This commit is contained in:
parent
463206948d
commit
e030bfb59d
20 changed files with 236 additions and 60 deletions
|
@ -2,6 +2,7 @@ import * as express from 'express'
|
|||
import toInt from 'validator/lib/toInt'
|
||||
import { doJSONRequest } from '@server/helpers/requests'
|
||||
import { LiveManager } from '@server/lib/live-manager'
|
||||
import { docMiddleware } from '@server/middlewares/doc'
|
||||
import { getServerActor } from '@server/models/application/application'
|
||||
import { MVideoAccountLight } from '@server/types/models'
|
||||
import { VideosCommonQuery } from '../../../../shared'
|
||||
|
@ -83,6 +84,7 @@ videosRouter.get('/:id/metadata/:videoFileId',
|
|||
asyncMiddleware(getVideoFileMetadata)
|
||||
)
|
||||
videosRouter.get('/:id',
|
||||
docMiddleware('https://docs.joinpeertube.org/api-rest-reference.html#operation/getVideo'),
|
||||
optionalAuthenticate,
|
||||
asyncMiddleware(videosCustomGetValidator('only-video-with-rights')),
|
||||
asyncMiddleware(checkVideoFollowConstraints),
|
||||
|
@ -94,6 +96,7 @@ videosRouter.post('/:id/views',
|
|||
)
|
||||
|
||||
videosRouter.delete('/:id',
|
||||
docMiddleware('https://docs.joinpeertube.org/api-rest-reference.html#operation/delVideo'),
|
||||
authenticate,
|
||||
asyncMiddleware(videosRemoveValidator),
|
||||
asyncRetryTransactionMiddleware(removeVideo)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue