aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/users/me.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api/users/me.ts')
-rw-r--r--server/controllers/api/users/me.ts22
1 files changed, 15 insertions, 7 deletions
diff --git a/server/controllers/api/users/me.ts b/server/controllers/api/users/me.ts
index 009cf42b7..c4e8d8130 100644
--- a/server/controllers/api/users/me.ts
+++ b/server/controllers/api/users/me.ts
@@ -1,7 +1,8 @@
1import 'multer' 1import 'multer'
2import * as express from 'express' 2import * as express from 'express'
3import { auditLoggerFactory, getAuditIdFromRes, UserAuditView } from '@server/helpers/audit-logger' 3import { auditLoggerFactory, getAuditIdFromRes, UserAuditView } from '@server/helpers/audit-logger'
4import { UserUpdateMe, UserVideoRate as FormattedUserVideoRate, VideoSortField } from '../../../../shared' 4import { Hooks } from '@server/lib/plugins/hooks'
5import { UserUpdateMe, UserVideoRate as FormattedUserVideoRate } from '../../../../shared'
5import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' 6import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
6import { UserVideoQuota } from '../../../../shared/models/users/user-video-quota.model' 7import { UserVideoQuota } from '../../../../shared/models/users/user-video-quota.model'
7import { createReqFiles } from '../../../helpers/express-utils' 8import { createReqFiles } from '../../../helpers/express-utils'
@@ -104,12 +105,19 @@ export {
104 105
105async function getUserVideos (req: express.Request, res: express.Response) { 106async function getUserVideos (req: express.Request, res: express.Response) {
106 const user = res.locals.oauth.token.User 107 const user = res.locals.oauth.token.User
107 const resultList = await VideoModel.listUserVideosForApi( 108
108 user.Account.id, 109 const apiOptions = await Hooks.wrapObject({
109 req.query.start as number, 110 accountId: user.Account.id,
110 req.query.count as number, 111 start: req.query.start,
111 req.query.sort as VideoSortField, 112 count: req.query.count,
112 req.query.search as string 113 sort: req.query.sort,
114 search: req.query.search
115 }, 'filter:api.user.me.videos.list.params')
116
117 const resultList = await Hooks.wrapPromiseFun(
118 VideoModel.listUserVideosForApi,
119 apiOptions,
120 'filter:api.user.me.videos.list.result'
113 ) 121 )
114 122
115 const additionalAttributes = { 123 const additionalAttributes = {