aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/users
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2020-07-23 21:30:04 +0200
committerRigel Kent <par@rigelk.eu>2020-07-29 18:15:53 +0200
commit4f5d045960b042eb27e10bac1bdaf1c074c9fa2a (patch)
tree09e1e8cce0a2e64146ede51941cfa2f1bdcf3c2f /server/controllers/api/users
parentbc99dfe54e093e69ba8fd06d36b36fbbda3f45de (diff)
downloadPeerTube-4f5d045960b042eb27e10bac1bdaf1c074c9fa2a.tar.gz
PeerTube-4f5d045960b042eb27e10bac1bdaf1c074c9fa2a.tar.zst
PeerTube-4f5d045960b042eb27e10bac1bdaf1c074c9fa2a.zip
harmonize search for libraries
Diffstat (limited to 'server/controllers/api/users')
-rw-r--r--server/controllers/api/users/my-subscriptions.ts11
1 files changed, 9 insertions, 2 deletions
diff --git a/server/controllers/api/users/my-subscriptions.ts b/server/controllers/api/users/my-subscriptions.ts
index efe1b9bc3..d207a19ae 100644
--- a/server/controllers/api/users/my-subscriptions.ts
+++ b/server/controllers/api/users/my-subscriptions.ts
@@ -13,7 +13,7 @@ import {
13 userSubscriptionAddValidator, 13 userSubscriptionAddValidator,
14 userSubscriptionGetValidator 14 userSubscriptionGetValidator
15} from '../../../middlewares' 15} from '../../../middlewares'
16import { areSubscriptionsExistValidator, userSubscriptionsSortValidator, videosSortValidator } from '../../../middlewares/validators' 16import { areSubscriptionsExistValidator, userSubscriptionsSortValidator, videosSortValidator, userSubscriptionListValidator } from '../../../middlewares/validators'
17import { VideoModel } from '../../../models/video/video' 17import { VideoModel } from '../../../models/video/video'
18import { buildNSFWFilter, getCountVideos } from '../../../helpers/express-utils' 18import { buildNSFWFilter, getCountVideos } from '../../../helpers/express-utils'
19import { VideoFilter } from '../../../../shared/models/videos/video-query.type' 19import { VideoFilter } from '../../../../shared/models/videos/video-query.type'
@@ -45,6 +45,7 @@ mySubscriptionsRouter.get('/me/subscriptions',
45 userSubscriptionsSortValidator, 45 userSubscriptionsSortValidator,
46 setDefaultSort, 46 setDefaultSort,
47 setDefaultPagination, 47 setDefaultPagination,
48 userSubscriptionListValidator,
48 asyncMiddleware(getUserSubscriptions) 49 asyncMiddleware(getUserSubscriptions)
49) 50)
50 51
@@ -141,7 +142,13 @@ async function getUserSubscriptions (req: express.Request, res: express.Response
141 const user = res.locals.oauth.token.User 142 const user = res.locals.oauth.token.User
142 const actorId = user.Account.Actor.id 143 const actorId = user.Account.Actor.id
143 144
144 const resultList = await ActorFollowModel.listSubscriptionsForApi(actorId, req.query.start, req.query.count, req.query.sort) 145 const resultList = await ActorFollowModel.listSubscriptionsForApi({
146 actorId,
147 start: req.query.start,
148 count: req.query.count,
149 sort: req.query.sort,
150 search: req.query.search
151 })
145 152
146 return res.json(getFormattedObjects(resultList.data, resultList.total)) 153 return res.json(getFormattedObjects(resultList.data, resultList.total))
147} 154}