]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/controllers/api/users/me.ts
Add ability to list imports of a channel sync
[github/Chocobozzz/PeerTube.git] / server / controllers / api / users / me.ts
index 595abcf959bd9ca4dcda8309cac27c3967d96161..00f580ee959f78abfa4977300116013d483acd43 100644 (file)
@@ -25,7 +25,13 @@ import {
   usersUpdateMeValidator,
   usersVideoRatingValidator
 } from '../../../middlewares'
-import { deleteMeValidator, usersVideosValidator, videoImportsSortValidator, videosSortValidator } from '../../../middlewares/validators'
+import {
+  deleteMeValidator,
+  getMyVideoImportsValidator,
+  usersVideosValidator,
+  videoImportsSortValidator,
+  videosSortValidator
+} from '../../../middlewares/validators'
 import { updateAvatarValidator } from '../../../middlewares/validators/actor-image'
 import { AccountModel } from '../../../models/account/account'
 import { AccountVideoRateModel } from '../../../models/account/account-video-rate'
@@ -60,6 +66,7 @@ meRouter.get('/me/videos/imports',
   videoImportsSortValidator,
   setDefaultSort,
   setDefaultPagination,
+  getMyVideoImportsValidator,
   asyncMiddleware(getUserVideoImports)
 )
 
@@ -138,7 +145,7 @@ async function getUserVideoImports (req: express.Request, res: express.Response)
   const resultList = await VideoImportModel.listUserVideoImportsForApi({
     userId: user.id,
 
-    ...pick(req.query, [ 'targetUrl', 'start', 'count', 'sort' ])
+    ...pick(req.query, [ 'targetUrl', 'start', 'count', 'sort', 'search', 'videoChannelSyncId' ])
   })
 
   return res.json(getFormattedObjects(resultList.data, resultList.total))