diff options
Diffstat (limited to 'server/controllers/api/users')
-rw-r--r-- | server/controllers/api/users/my-history.ts | 4 |
1 files changed, 3 insertions, 1 deletions
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 { | |||
5 | authenticate, | 5 | authenticate, |
6 | paginationValidator, | 6 | paginationValidator, |
7 | setDefaultPagination, | 7 | setDefaultPagination, |
8 | userHistoryListValidator, | ||
8 | userHistoryRemoveValidator | 9 | userHistoryRemoveValidator |
9 | } from '../../../middlewares' | 10 | } from '../../../middlewares' |
10 | import { getFormattedObjects } from '../../../helpers/utils' | 11 | import { getFormattedObjects } from '../../../helpers/utils' |
@@ -18,6 +19,7 @@ myVideosHistoryRouter.get('/me/history/videos', | |||
18 | authenticate, | 19 | authenticate, |
19 | paginationValidator, | 20 | paginationValidator, |
20 | setDefaultPagination, | 21 | setDefaultPagination, |
22 | userHistoryListValidator, | ||
21 | asyncMiddleware(listMyVideosHistory) | 23 | asyncMiddleware(listMyVideosHistory) |
22 | ) | 24 | ) |
23 | 25 | ||
@@ -38,7 +40,7 @@ export { | |||
38 | async function listMyVideosHistory (req: express.Request, res: express.Response) { | 40 | async function listMyVideosHistory (req: express.Request, res: express.Response) { |
39 | const user = res.locals.oauth.token.User | 41 | const user = res.locals.oauth.token.User |
40 | 42 | ||
41 | const resultList = await UserVideoHistoryModel.listForApi(user, req.query.start, req.query.count) | 43 | const resultList = await UserVideoHistoryModel.listForApi(user, req.query.start, req.query.count, req.query.search) |
42 | 44 | ||
43 | return res.json(getFormattedObjects(resultList.data, resultList.total)) | 45 | return res.json(getFormattedObjects(resultList.data, resultList.total)) |
44 | } | 46 | } |