aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api')
-rw-r--r--server/controllers/api/users.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/server/controllers/api/users.ts b/server/controllers/api/users.ts
index 2342c23dd..0a591f11d 100644
--- a/server/controllers/api/users.ts
+++ b/server/controllers/api/users.ts
@@ -44,6 +44,7 @@ import { OAuthTokenModel } from '../../models/oauth/oauth-token'
44import { VideoModel } from '../../models/video/video' 44import { VideoModel } from '../../models/video/video'
45import { VideoSortField } from '../../../client/src/app/shared/video/sort-field.type' 45import { VideoSortField } from '../../../client/src/app/shared/video/sort-field.type'
46import { createReqFiles } from '../../helpers/express-utils' 46import { createReqFiles } from '../../helpers/express-utils'
47import { UserVideoQuota } from '../../../shared/models/users/user-video-quota.model'
47 48
48const reqAvatarFile = createReqFiles([ 'avatarfile' ], IMAGE_MIMETYPE_EXT, { avatarfile: CONFIG.STORAGE.AVATARS_DIR }) 49const reqAvatarFile = createReqFiles([ 'avatarfile' ], IMAGE_MIMETYPE_EXT, { avatarfile: CONFIG.STORAGE.AVATARS_DIR })
49const loginRateLimiter = new RateLimit({ 50const loginRateLimiter = new RateLimit({
@@ -253,9 +254,10 @@ async function getUserVideoQuotaUsed (req: express.Request, res: express.Respons
253 const user = await UserModel.loadByUsernameAndPopulateChannels(res.locals.oauth.token.user.username) 254 const user = await UserModel.loadByUsernameAndPopulateChannels(res.locals.oauth.token.user.username)
254 const videoQuotaUsed = await UserModel.getOriginalVideoFileTotalFromUser(user) 255 const videoQuotaUsed = await UserModel.getOriginalVideoFileTotalFromUser(user)
255 256
256 return res.json({ 257 const data: UserVideoQuota = {
257 videoQuotaUsed 258 videoQuotaUsed
258 }) 259 }
260 return res.json(data)
259} 261}
260 262
261function getUser (req: express.Request, res: express.Response, next: express.NextFunction) { 263function getUser (req: express.Request, res: express.Response, next: express.NextFunction) {