From d8b34ee55b654912f86bb8b472d391ced8c28f64 Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Wed, 13 Jan 2021 09:16:15 +0100 Subject: 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 --- server/controllers/api/users/my-history.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'server/controllers/api') diff --git a/server/controllers/api/users/my-history.ts b/server/controllers/api/users/my-history.ts index 80d4dc748..72c7da373 100644 --- a/server/controllers/api/users/my-history.ts +++ b/server/controllers/api/users/my-history.ts @@ -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)) } -- cgit v1.2.3