1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-06 03:50:26 +02:00

harmonize search for libraries

This commit is contained in:
Rigel Kent 2020-07-23 21:30:04 +02:00 committed by Rigel Kent
parent bc99dfe54e
commit 4f5d045960
32 changed files with 295 additions and 102 deletions

View file

@ -120,7 +120,8 @@ async function listAccountChannels (req: express.Request, res: express.Response)
start: req.query.start,
count: req.query.count,
sort: req.query.sort,
withStats: req.query.withStats
withStats: req.query.withStats,
search: req.query.search
}
const resultList = await VideoChannelModel.listByAccount(options)

View file

@ -13,7 +13,7 @@ import {
userSubscriptionAddValidator,
userSubscriptionGetValidator
} from '../../../middlewares'
import { areSubscriptionsExistValidator, userSubscriptionsSortValidator, videosSortValidator } from '../../../middlewares/validators'
import { areSubscriptionsExistValidator, userSubscriptionsSortValidator, videosSortValidator, userSubscriptionListValidator } from '../../../middlewares/validators'
import { VideoModel } from '../../../models/video/video'
import { buildNSFWFilter, getCountVideos } from '../../../helpers/express-utils'
import { VideoFilter } from '../../../../shared/models/videos/video-query.type'
@ -45,6 +45,7 @@ mySubscriptionsRouter.get('/me/subscriptions',
userSubscriptionsSortValidator,
setDefaultSort,
setDefaultPagination,
userSubscriptionListValidator,
asyncMiddleware(getUserSubscriptions)
)
@ -141,7 +142,13 @@ async function getUserSubscriptions (req: express.Request, res: express.Response
const user = res.locals.oauth.token.User
const actorId = user.Account.Actor.id
const resultList = await ActorFollowModel.listSubscriptionsForApi(actorId, req.query.start, req.query.count, req.query.sort)
const resultList = await ActorFollowModel.listSubscriptionsForApi({
actorId,
start: req.query.start,
count: req.query.count,
sort: req.query.sort,
search: req.query.search
})
return res.json(getFormattedObjects(resultList.data, resultList.total))
}

View file

@ -119,8 +119,7 @@ async function listVideoChannels (req: express.Request, res: express.Response) {
actorId: serverActor.id,
start: req.query.start,
count: req.query.count,
sort: req.query.sort,
search: req.query.search
sort: req.query.sort
})
return res.json(getFormattedObjects(resultList.data, resultList.total))