From d511df28906f84c7d25ecb24e41515ed549ff276 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 19 Jan 2022 14:58:16 +0100 Subject: Add ability to filter my imports by target URL --- server/controllers/api/users/me.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'server/controllers/api') 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 import { UserModel } from '../../../models/user/user' import { VideoModel } from '../../../models/video/video' import { VideoImportModel } from '../../../models/video/video-import' +import { pick } from '@shared/core-utils' const auditLogger = auditLoggerFactory('users') @@ -133,12 +134,11 @@ async function getUserVideos (req: express.Request, res: express.Response) { async function getUserVideoImports (req: express.Request, res: express.Response) { const user = res.locals.oauth.token.User - const resultList = await VideoImportModel.listUserVideoImportsForApi( - user.id, - req.query.start as number, - req.query.count as number, - req.query.sort - ) + const resultList = await VideoImportModel.listUserVideoImportsForApi({ + userId: user.id, + + ...pick(req.query, [ 'targetUrl', 'start', 'count', 'sort' ]) + }) return res.json(getFormattedObjects(resultList.data, resultList.total)) } -- cgit v1.2.3