aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/users.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/users.ts
parentfcaf1e0aa84213a1b1f1b1a44a3276eae35ebe70 (diff)
downloadPeerTube-a2431b7dcbc72c05101dcdbe631ff84a823aeb51.tar.gz
PeerTube-a2431b7dcbc72c05101dcdbe631ff84a823aeb51.tar.zst
PeerTube-a2431b7dcbc72c05101dcdbe631ff84a823aeb51.zip
Refractor validators
Diffstat (limited to 'server/controllers/api/users.ts')
-rw-r--r--server/controllers/api/users.ts16
1 files changed, 8 insertions, 8 deletions
diff --git a/server/controllers/api/users.ts b/server/controllers/api/users.ts
index ac7c87517..721b23301 100644
--- a/server/controllers/api/users.ts
+++ b/server/controllers/api/users.ts
@@ -43,7 +43,7 @@ usersRouter.get('/me/videos',
43 43
44usersRouter.get('/me/videos/:videoId/rating', 44usersRouter.get('/me/videos/:videoId/rating',
45 authenticate, 45 authenticate,
46 usersVideoRatingValidator, 46 asyncMiddleware(usersVideoRatingValidator),
47 asyncMiddleware(getUserVideoRating) 47 asyncMiddleware(getUserVideoRating)
48) 48)
49 49
@@ -56,20 +56,20 @@ usersRouter.get('/',
56) 56)
57 57
58usersRouter.get('/:id', 58usersRouter.get('/:id',
59 usersGetValidator, 59 asyncMiddleware(usersGetValidator),
60 getUser 60 getUser
61) 61)
62 62
63usersRouter.post('/', 63usersRouter.post('/',
64 authenticate, 64 authenticate,
65 ensureUserHasRight(UserRight.MANAGE_USERS), 65 ensureUserHasRight(UserRight.MANAGE_USERS),
66 usersAddValidator, 66 asyncMiddleware(usersAddValidator),
67 createUserRetryWrapper 67 asyncMiddleware(createUserRetryWrapper)
68) 68)
69 69
70usersRouter.post('/register', 70usersRouter.post('/register',
71 ensureUserRegistrationAllowed, 71 asyncMiddleware(ensureUserRegistrationAllowed),
72 usersRegisterValidator, 72 asyncMiddleware(usersRegisterValidator),
73 asyncMiddleware(registerUserRetryWrapper) 73 asyncMiddleware(registerUserRetryWrapper)
74) 74)
75 75
@@ -82,14 +82,14 @@ usersRouter.put('/me',
82usersRouter.put('/:id', 82usersRouter.put('/:id',
83 authenticate, 83 authenticate,
84 ensureUserHasRight(UserRight.MANAGE_USERS), 84 ensureUserHasRight(UserRight.MANAGE_USERS),
85 usersUpdateValidator, 85 asyncMiddleware(usersUpdateValidator),
86 asyncMiddleware(updateUser) 86 asyncMiddleware(updateUser)
87) 87)
88 88
89usersRouter.delete('/:id', 89usersRouter.delete('/:id',
90 authenticate, 90 authenticate,
91 ensureUserHasRight(UserRight.MANAGE_USERS), 91 ensureUserHasRight(UserRight.MANAGE_USERS),
92 usersRemoveValidator, 92 asyncMiddleware(usersRemoveValidator),
93 asyncMiddleware(removeUser) 93 asyncMiddleware(removeUser)
94) 94)
95 95