diff options
author | Chocobozzz <me@florianbigard.com> | 2019-03-05 10:58:44 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2019-03-18 11:17:59 +0100 |
commit | df0b219d36bf6852cdf2a7ad09ed4a41c6bccefa (patch) | |
tree | c4984e854f5dc18e5c27afd73b843bd52c143034 /server/controllers/api/accounts.ts | |
parent | 07b1a18aa678d260009a93e36606c5c5f585723d (diff) | |
download | PeerTube-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.ts | 5 |
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' | |||
18 | import { logger } from '../../helpers/logger' | 18 | import { logger } from '../../helpers/logger' |
19 | import { VideoPlaylistModel } from '../../models/video/video-playlist' | 19 | import { VideoPlaylistModel } from '../../models/video/video-playlist' |
20 | import { UserModel } from '../../models/account/user' | 20 | import { UserModel } from '../../models/account/user' |
21 | import { commonVideoPlaylistFiltersValidator } from '../../middlewares/validators/videos/video-playlists' | ||
21 | 22 | ||
22 | const accountsRouter = express.Router() | 23 | const 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)) |