aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/videos/channel.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-11-27 17:30:46 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-11-27 19:43:01 +0100
commita2431b7dcbc72c05101dcdbe631ff84a823aeb51 (patch)
tree09278a822905622a70ff976a75e09d99bc45639a /server/controllers/api/videos/channel.ts
parentfcaf1e0aa84213a1b1f1b1a44a3276eae35ebe70 (diff)
downloadPeerTube-a2431b7dcbc72c05101dcdbe631ff84a823aeb51.tar.gz
PeerTube-a2431b7dcbc72c05101dcdbe631ff84a823aeb51.tar.zst
PeerTube-a2431b7dcbc72c05101dcdbe631ff84a823aeb51.zip
Refractor validators
Diffstat (limited to 'server/controllers/api/videos/channel.ts')
-rw-r--r--server/controllers/api/videos/channel.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/server/controllers/api/videos/channel.ts b/server/controllers/api/videos/channel.ts
index ce2656e71..d99f47c32 100644
--- a/server/controllers/api/videos/channel.ts
+++ b/server/controllers/api/videos/channel.ts
@@ -3,6 +3,7 @@ import { VideoChannelCreate, VideoChannelUpdate } from '../../../../shared'
3import { getFormattedObjects, logger, resetSequelizeInstance, retryTransactionWrapper } from '../../../helpers' 3import { getFormattedObjects, logger, resetSequelizeInstance, retryTransactionWrapper } from '../../../helpers'
4import { database as db } from '../../../initializers' 4import { database as db } from '../../../initializers'
5import { createVideoChannel } from '../../../lib' 5import { createVideoChannel } from '../../../lib'
6import { sendUpdateVideoChannel } from '../../../lib/activitypub/send/send-update'
6import { 7import {
7 asyncMiddleware, 8 asyncMiddleware,
8 authenticate, 9 authenticate,
@@ -10,14 +11,13 @@ import {
10 paginationValidator, 11 paginationValidator,
11 setPagination, 12 setPagination,
12 setVideoChannelsSort, 13 setVideoChannelsSort,
13 videoChannelsGetValidator,
14 videoChannelsAddValidator, 14 videoChannelsAddValidator,
15 videoChannelsGetValidator,
15 videoChannelsRemoveValidator, 16 videoChannelsRemoveValidator,
16 videoChannelsSortValidator, 17 videoChannelsSortValidator,
17 videoChannelsUpdateValidator 18 videoChannelsUpdateValidator
18} from '../../../middlewares' 19} from '../../../middlewares'
19import { AccountInstance, VideoChannelInstance } from '../../../models' 20import { AccountInstance, VideoChannelInstance } from '../../../models'
20import { sendUpdateVideoChannel } from '../../../lib/activitypub/send/send-update'
21 21
22const videoChannelRouter = express.Router() 22const videoChannelRouter = express.Router()
23 23
@@ -30,7 +30,7 @@ videoChannelRouter.get('/channels',
30) 30)
31 31
32videoChannelRouter.get('/accounts/:accountId/channels', 32videoChannelRouter.get('/accounts/:accountId/channels',
33 listVideoAccountChannelsValidator, 33 asyncMiddleware(listVideoAccountChannelsValidator),
34 asyncMiddleware(listVideoAccountChannels) 34 asyncMiddleware(listVideoAccountChannels)
35) 35)
36 36
@@ -42,18 +42,18 @@ videoChannelRouter.post('/channels',
42 42
43videoChannelRouter.put('/channels/:id', 43videoChannelRouter.put('/channels/:id',
44 authenticate, 44 authenticate,
45 videoChannelsUpdateValidator, 45 asyncMiddleware(videoChannelsUpdateValidator),
46 updateVideoChannelRetryWrapper 46 updateVideoChannelRetryWrapper
47) 47)
48 48
49videoChannelRouter.delete('/channels/:id', 49videoChannelRouter.delete('/channels/:id',
50 authenticate, 50 authenticate,
51 videoChannelsRemoveValidator, 51 asyncMiddleware(videoChannelsRemoveValidator),
52 asyncMiddleware(removeVideoChannelRetryWrapper) 52 asyncMiddleware(removeVideoChannelRetryWrapper)
53) 53)
54 54
55videoChannelRouter.get('/channels/:id', 55videoChannelRouter.get('/channels/:id',
56 videoChannelsGetValidator, 56 asyncMiddleware(videoChannelsGetValidator),
57 asyncMiddleware(getVideoChannel) 57 asyncMiddleware(getVideoChannel)
58) 58)
59 59