From ad9e39fb815d85e5e718c40540fa75471474fa17 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 25 May 2018 09:57:16 +0200 Subject: Only use account name in routes --- server/controllers/api/accounts.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'server/controllers/api') 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 { 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) ) -- cgit v1.2.3