aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/accounts.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-03-05 10:58:44 +0100
committerChocobozzz <chocobozzz@cpy.re>2019-03-18 11:17:59 +0100
commitdf0b219d36bf6852cdf2a7ad09ed4a41c6bccefa (patch)
treec4984e854f5dc18e5c27afd73b843bd52c143034 /server/controllers/api/accounts.ts
parent07b1a18aa678d260009a93e36606c5c5f585723d (diff)
downloadPeerTube-df0b219d36bf6852cdf2a7ad09ed4a41c6bccefa.tar.gz
PeerTube-df0b219d36bf6852cdf2a7ad09ed4a41c6bccefa.tar.zst
PeerTube-df0b219d36bf6852cdf2a7ad09ed4a41c6bccefa.zip
Add playlist rest tests
Diffstat (limited to 'server/controllers/api/accounts.ts')
-rw-r--r--server/controllers/api/accounts.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/server/controllers/api/accounts.ts b/server/controllers/api/accounts.ts
index 03c831092..e24545de8 100644
--- a/server/controllers/api/accounts.ts
+++ b/server/controllers/api/accounts.ts
@@ -18,6 +18,7 @@ import { JobQueue } from '../../lib/job-queue'
18import { logger } from '../../helpers/logger' 18import { logger } from '../../helpers/logger'
19import { VideoPlaylistModel } from '../../models/video/video-playlist' 19import { VideoPlaylistModel } from '../../models/video/video-playlist'
20import { UserModel } from '../../models/account/user' 20import { UserModel } from '../../models/account/user'
21import { commonVideoPlaylistFiltersValidator } from '../../middlewares/validators/videos/video-playlists'
21 22
22const accountsRouter = express.Router() 23const accountsRouter = express.Router()
23 24
@@ -57,6 +58,7 @@ accountsRouter.get('/:accountName/video-playlists',
57 videoPlaylistsSortValidator, 58 videoPlaylistsSortValidator,
58 setDefaultSort, 59 setDefaultSort,
59 setDefaultPagination, 60 setDefaultPagination,
61 commonVideoPlaylistFiltersValidator,
60 asyncMiddleware(listAccountPlaylists) 62 asyncMiddleware(listAccountPlaylists)
61) 63)
62 64
@@ -106,7 +108,8 @@ async function listAccountPlaylists (req: express.Request, res: express.Response
106 count: req.query.count, 108 count: req.query.count,
107 sort: req.query.sort, 109 sort: req.query.sort,
108 accountId: res.locals.account.id, 110 accountId: res.locals.account.id,
109 privateAndUnlisted 111 privateAndUnlisted,
112 type: req.query.playlistType
110 }) 113 })
111 114
112 return res.json(getFormattedObjects(resultList.data, resultList.total)) 115 return res.json(getFormattedObjects(resultList.data, resultList.total))