mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-03 17:59:37 +02:00
Only use account name in routes
This commit is contained in:
parent
06be7ed0b2
commit
ad9e39fb81
28 changed files with 333 additions and 110 deletions
|
@ -8,7 +8,7 @@ import {
|
|||
setDefaultPagination,
|
||||
setDefaultSort
|
||||
} from '../../middlewares'
|
||||
import { accountsGetValidator, accountsSortValidator, videosSortValidator } from '../../middlewares/validators'
|
||||
import { accountsNameWithHostGetValidator, accountsSortValidator, videosSortValidator } from '../../middlewares/validators'
|
||||
import { AccountModel } from '../../models/account/account'
|
||||
import { VideoModel } from '../../models/video/video'
|
||||
import { isNSFWHidden } from '../../helpers/express-utils'
|
||||
|
@ -24,13 +24,13 @@ accountsRouter.get('/',
|
|||
asyncMiddleware(listAccounts)
|
||||
)
|
||||
|
||||
accountsRouter.get('/:id',
|
||||
asyncMiddleware(accountsGetValidator),
|
||||
accountsRouter.get('/:accountName',
|
||||
asyncMiddleware(accountsNameWithHostGetValidator),
|
||||
getAccount
|
||||
)
|
||||
|
||||
accountsRouter.get('/:id/videos',
|
||||
asyncMiddleware(accountsGetValidator),
|
||||
accountsRouter.get('/:accountName/videos',
|
||||
asyncMiddleware(accountsNameWithHostGetValidator),
|
||||
paginationValidator,
|
||||
videosSortValidator,
|
||||
setDefaultSort,
|
||||
|
@ -39,7 +39,7 @@ accountsRouter.get('/:id/videos',
|
|||
asyncMiddleware(listAccountVideos)
|
||||
)
|
||||
|
||||
accountsRouter.get('/:accountId/video-channels',
|
||||
accountsRouter.get('/:accountName/video-channels',
|
||||
asyncMiddleware(listVideoAccountChannelsValidator),
|
||||
asyncMiddleware(listVideoAccountChannels)
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue