diff options
author | Chocobozzz <me@florianbigard.com> | 2018-05-25 09:57:16 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-05-25 10:41:07 +0200 |
commit | ad9e39fb815d85e5e718c40540fa75471474fa17 (patch) | |
tree | 960accb16bca0fac7694b3f3d5d038534b66c224 /server/controllers/api/accounts.ts | |
parent | 06be7ed0b27b371465c5d1b7f92b4adfb0b866ea (diff) | |
download | PeerTube-ad9e39fb815d85e5e718c40540fa75471474fa17.tar.gz PeerTube-ad9e39fb815d85e5e718c40540fa75471474fa17.tar.zst PeerTube-ad9e39fb815d85e5e718c40540fa75471474fa17.zip |
Only use account name in routes
Diffstat (limited to 'server/controllers/api/accounts.ts')
-rw-r--r-- | server/controllers/api/accounts.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/server/controllers/api/accounts.ts b/server/controllers/api/accounts.ts index ccae0436b..8e937276c 100644 --- a/server/controllers/api/accounts.ts +++ b/server/controllers/api/accounts.ts | |||
@@ -8,7 +8,7 @@ import { | |||
8 | setDefaultPagination, | 8 | setDefaultPagination, |
9 | setDefaultSort | 9 | setDefaultSort |
10 | } from '../../middlewares' | 10 | } from '../../middlewares' |
11 | import { accountsGetValidator, accountsSortValidator, videosSortValidator } from '../../middlewares/validators' | 11 | import { accountsNameWithHostGetValidator, accountsSortValidator, videosSortValidator } from '../../middlewares/validators' |
12 | import { AccountModel } from '../../models/account/account' | 12 | import { AccountModel } from '../../models/account/account' |
13 | import { VideoModel } from '../../models/video/video' | 13 | import { VideoModel } from '../../models/video/video' |
14 | import { isNSFWHidden } from '../../helpers/express-utils' | 14 | import { isNSFWHidden } from '../../helpers/express-utils' |
@@ -24,13 +24,13 @@ accountsRouter.get('/', | |||
24 | asyncMiddleware(listAccounts) | 24 | asyncMiddleware(listAccounts) |
25 | ) | 25 | ) |
26 | 26 | ||
27 | accountsRouter.get('/:id', | 27 | accountsRouter.get('/:accountName', |
28 | asyncMiddleware(accountsGetValidator), | 28 | asyncMiddleware(accountsNameWithHostGetValidator), |
29 | getAccount | 29 | getAccount |
30 | ) | 30 | ) |
31 | 31 | ||
32 | accountsRouter.get('/:id/videos', | 32 | accountsRouter.get('/:accountName/videos', |
33 | asyncMiddleware(accountsGetValidator), | 33 | asyncMiddleware(accountsNameWithHostGetValidator), |
34 | paginationValidator, | 34 | paginationValidator, |
35 | videosSortValidator, | 35 | videosSortValidator, |
36 | setDefaultSort, | 36 | setDefaultSort, |
@@ -39,7 +39,7 @@ accountsRouter.get('/:id/videos', | |||
39 | asyncMiddleware(listAccountVideos) | 39 | asyncMiddleware(listAccountVideos) |
40 | ) | 40 | ) |
41 | 41 | ||
42 | accountsRouter.get('/:accountId/video-channels', | 42 | accountsRouter.get('/:accountName/video-channels', |
43 | asyncMiddleware(listVideoAccountChannelsValidator), | 43 | asyncMiddleware(listVideoAccountChannelsValidator), |
44 | asyncMiddleware(listVideoAccountChannels) | 44 | asyncMiddleware(listVideoAccountChannels) |
45 | ) | 45 | ) |