diff options
Diffstat (limited to 'server/controllers')
-rw-r--r-- | server/controllers/api/users.ts | 6 |
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' | |||
44 | import { VideoModel } from '../../models/video/video' | 44 | import { VideoModel } from '../../models/video/video' |
45 | import { VideoSortField } from '../../../client/src/app/shared/video/sort-field.type' | 45 | import { VideoSortField } from '../../../client/src/app/shared/video/sort-field.type' |
46 | import { createReqFiles } from '../../helpers/express-utils' | 46 | import { createReqFiles } from '../../helpers/express-utils' |
47 | import { UserVideoQuota } from '../../../shared/models/users/user-video-quota.model' | ||
47 | 48 | ||
48 | const reqAvatarFile = createReqFiles([ 'avatarfile' ], IMAGE_MIMETYPE_EXT, { avatarfile: CONFIG.STORAGE.AVATARS_DIR }) | 49 | const reqAvatarFile = createReqFiles([ 'avatarfile' ], IMAGE_MIMETYPE_EXT, { avatarfile: CONFIG.STORAGE.AVATARS_DIR }) |
49 | const loginRateLimiter = new RateLimit({ | 50 | const 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 | ||
261 | function getUser (req: express.Request, res: express.Response, next: express.NextFunction) { | 263 | function getUser (req: express.Request, res: express.Response, next: express.NextFunction) { |