aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-01-19 14:58:16 +0100
committerChocobozzz <me@florianbigard.com>2022-01-19 14:58:16 +0100
commitd511df28906f84c7d25ecb24e41515ed549ff276 (patch)
treebc9caa33fae684e9971068011dd10243c7d0fe60 /server/controllers/api
parent419b520ca4434d17f3505013174e195c3a316716 (diff)
downloadPeerTube-d511df28906f84c7d25ecb24e41515ed549ff276.tar.gz
PeerTube-d511df28906f84c7d25ecb24e41515ed549ff276.tar.zst
PeerTube-d511df28906f84c7d25ecb24e41515ed549ff276.zip
Add ability to filter my imports by target URL
Diffstat (limited to 'server/controllers/api')
-rw-r--r--server/controllers/api/users/me.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/server/controllers/api/users/me.ts b/server/controllers/api/users/me.ts
index 878dd5a84..c2ad0b710 100644
--- a/server/controllers/api/users/me.ts
+++ b/server/controllers/api/users/me.ts
@@ -30,6 +30,7 @@ import { AccountVideoRateModel } from '../../../models/account/account-video-rat
30import { UserModel } from '../../../models/user/user' 30import { UserModel } from '../../../models/user/user'
31import { VideoModel } from '../../../models/video/video' 31import { VideoModel } from '../../../models/video/video'
32import { VideoImportModel } from '../../../models/video/video-import' 32import { VideoImportModel } from '../../../models/video/video-import'
33import { pick } from '@shared/core-utils'
33 34
34const auditLogger = auditLoggerFactory('users') 35const auditLogger = auditLoggerFactory('users')
35 36
@@ -133,12 +134,11 @@ async function getUserVideos (req: express.Request, res: express.Response) {
133 134
134async function getUserVideoImports (req: express.Request, res: express.Response) { 135async function getUserVideoImports (req: express.Request, res: express.Response) {
135 const user = res.locals.oauth.token.User 136 const user = res.locals.oauth.token.User
136 const resultList = await VideoImportModel.listUserVideoImportsForApi( 137 const resultList = await VideoImportModel.listUserVideoImportsForApi({
137 user.id, 138 userId: user.id,
138 req.query.start as number, 139
139 req.query.count as number, 140 ...pick(req.query, [ 'targetUrl', 'start', 'count', 'sort' ])
140 req.query.sort 141 })
141 )
142 142
143 return res.json(getFormattedObjects(resultList.data, resultList.total)) 143 return res.json(getFormattedObjects(resultList.data, resultList.total))
144} 144}