diff options
author | Chocobozzz <me@florianbigard.com> | 2022-01-19 14:58:16 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-01-19 14:58:16 +0100 |
commit | d511df28906f84c7d25ecb24e41515ed549ff276 (patch) | |
tree | bc9caa33fae684e9971068011dd10243c7d0fe60 /server/controllers/api | |
parent | 419b520ca4434d17f3505013174e195c3a316716 (diff) | |
download | PeerTube-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.ts | 12 |
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 | |||
30 | import { UserModel } from '../../../models/user/user' | 30 | import { UserModel } from '../../../models/user/user' |
31 | import { VideoModel } from '../../../models/video/video' | 31 | import { VideoModel } from '../../../models/video/video' |
32 | import { VideoImportModel } from '../../../models/video/video-import' | 32 | import { VideoImportModel } from '../../../models/video/video-import' |
33 | import { pick } from '@shared/core-utils' | ||
33 | 34 | ||
34 | const auditLogger = auditLoggerFactory('users') | 35 | const auditLogger = auditLoggerFactory('users') |
35 | 36 | ||
@@ -133,12 +134,11 @@ async function getUserVideos (req: express.Request, res: express.Response) { | |||
133 | 134 | ||
134 | async function getUserVideoImports (req: express.Request, res: express.Response) { | 135 | async 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 | } |