X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fcontrollers%2Fapi%2Faccounts.ts;h=8e937276cde72ac2af7499bf010a460597dcf2a1;hb=b81eb8fdc6fabbe517d5731c26da773206ebba62;hp=ccae0436b12cc1f49f9bc0e10fe971ef137f1bce;hpb=cc918ac3f45e32f031cce7b6e0473e5c2c34b8ae;p=github%2FChocobozzz%2FPeerTube.git 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) )