aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/users
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api/users')
-rw-r--r--server/controllers/api/users/me.ts7
1 files changed, 3 insertions, 4 deletions
diff --git a/server/controllers/api/users/me.ts b/server/controllers/api/users/me.ts
index 2f3efe6aa..ac7c62aab 100644
--- a/server/controllers/api/users/me.ts
+++ b/server/controllers/api/users/me.ts
@@ -126,14 +126,13 @@ async function getUserVideoImports (req: express.Request, res: express.Response)
126 126
127async function getUserInformation (req: express.Request, res: express.Response) { 127async function getUserInformation (req: express.Request, res: express.Response) {
128 // We did not load channels in res.locals.user 128 // We did not load channels in res.locals.user
129 const user = await UserModel.loadByUsernameAndPopulateChannels(res.locals.oauth.token.user.username) 129 const user = await UserModel.loadForMeAPI(res.locals.oauth.token.user.username)
130 130
131 return res.json(user.toFormattedJSON({ me: true })) 131 return res.json(user.toMeFormattedJSON())
132} 132}
133 133
134async function getUserVideoQuotaUsed (req: express.Request, res: express.Response) { 134async function getUserVideoQuotaUsed (req: express.Request, res: express.Response) {
135 // We did not load channels in res.locals.user 135 const user = res.locals.oauth.token.user
136 const user = await UserModel.loadByUsernameAndPopulateChannels(res.locals.oauth.token.user.username)
137 const videoQuotaUsed = await UserModel.getOriginalVideoFileTotalFromUser(user) 136 const videoQuotaUsed = await UserModel.getOriginalVideoFileTotalFromUser(user)
138 const videoQuotaUsedDaily = await UserModel.getOriginalVideoFileTotalDailyFromUser(user) 137 const videoQuotaUsedDaily = await UserModel.getOriginalVideoFileTotalDailyFromUser(user)
139 138