mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 18:29:27 +02:00
Allow user to search through their watch history (#3576)
* allow user to search through their watch history * add tests for search in watch history * Update client/src/app/shared/shared-main/users/user-history.service.ts
This commit is contained in:
parent
22078471fb
commit
d8b34ee55b
12 changed files with 97 additions and 16 deletions
|
@ -5,6 +5,7 @@ import {
|
|||
authenticate,
|
||||
paginationValidator,
|
||||
setDefaultPagination,
|
||||
userHistoryListValidator,
|
||||
userHistoryRemoveValidator
|
||||
} from '../../../middlewares'
|
||||
import { getFormattedObjects } from '../../../helpers/utils'
|
||||
|
@ -18,6 +19,7 @@ myVideosHistoryRouter.get('/me/history/videos',
|
|||
authenticate,
|
||||
paginationValidator,
|
||||
setDefaultPagination,
|
||||
userHistoryListValidator,
|
||||
asyncMiddleware(listMyVideosHistory)
|
||||
)
|
||||
|
||||
|
@ -38,7 +40,7 @@ export {
|
|||
async function listMyVideosHistory (req: express.Request, res: express.Response) {
|
||||
const user = res.locals.oauth.token.User
|
||||
|
||||
const resultList = await UserVideoHistoryModel.listForApi(user, req.query.start, req.query.count)
|
||||
const resultList = await UserVideoHistoryModel.listForApi(user, req.query.start, req.query.count, req.query.search)
|
||||
|
||||
return res.json(getFormattedObjects(resultList.data, resultList.total))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue