diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-07-11 17:04:57 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-07-11 17:05:55 +0200 |
commit | 075f16caac5236cb04c98ae7b3a989766d764bb3 (patch) | |
tree | 9a30024aa771735a28d83d9a166033b82dbcaf60 /server/middlewares/validators/users.ts | |
parent | 4e979c3e1b81f4762025d9db3052b1f70774b3bb (diff) | |
download | PeerTube-075f16caac5236cb04c98ae7b3a989766d764bb3.tar.gz PeerTube-075f16caac5236cb04c98ae7b3a989766d764bb3.tar.zst PeerTube-075f16caac5236cb04c98ae7b3a989766d764bb3.zip |
Remove "function" in favor of () => {}
Diffstat (limited to 'server/middlewares/validators/users.ts')
-rw-r--r-- | server/middlewares/validators/users.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/middlewares/validators/users.ts b/server/middlewares/validators/users.ts index 90a46752c..38f8aed5b 100644 --- a/server/middlewares/validators/users.ts +++ b/server/middlewares/validators/users.ts | |||
@@ -15,7 +15,7 @@ function usersAddValidator (req: express.Request, res: express.Response, next: e | |||
15 | 15 | ||
16 | logger.debug('Checking usersAdd parameters', { parameters: req.body }) | 16 | logger.debug('Checking usersAdd parameters', { parameters: req.body }) |
17 | 17 | ||
18 | checkErrors(req, res, function () { | 18 | checkErrors(req, res, () => { |
19 | db.User.loadByUsernameOrEmail(req.body.username, req.body.email) | 19 | db.User.loadByUsernameOrEmail(req.body.username, req.body.email) |
20 | .then(user => { | 20 | .then(user => { |
21 | if (user) return res.status(409).send('User already exists.') | 21 | if (user) return res.status(409).send('User already exists.') |
@@ -34,7 +34,7 @@ function usersRemoveValidator (req: express.Request, res: express.Response, next | |||
34 | 34 | ||
35 | logger.debug('Checking usersRemove parameters', { parameters: req.params }) | 35 | logger.debug('Checking usersRemove parameters', { parameters: req.params }) |
36 | 36 | ||
37 | checkErrors(req, res, function () { | 37 | checkErrors(req, res, () => { |
38 | db.User.loadById(req.params.id) | 38 | db.User.loadById(req.params.id) |
39 | .then(user => { | 39 | .then(user => { |
40 | if (!user) return res.status(404).send('User not found') | 40 | if (!user) return res.status(404).send('User not found') |
@@ -66,7 +66,7 @@ function usersVideoRatingValidator (req: express.Request, res: express.Response, | |||
66 | 66 | ||
67 | logger.debug('Checking usersVideoRating parameters', { parameters: req.params }) | 67 | logger.debug('Checking usersVideoRating parameters', { parameters: req.params }) |
68 | 68 | ||
69 | checkErrors(req, res, function () { | 69 | checkErrors(req, res, () => { |
70 | let videoPromise: Promise<VideoInstance> | 70 | let videoPromise: Promise<VideoInstance> |
71 | 71 | ||
72 | if (validator.isUUID(req.params.videoId)) { | 72 | if (validator.isUUID(req.params.videoId)) { |