aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/users/my-subscriptions.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api/users/my-subscriptions.ts')
-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}