aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/users/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api/users/index.ts')
-rw-r--r--server/controllers/api/users/index.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/server/controllers/api/users/index.ts b/server/controllers/api/users/index.ts
index 608d439ac..25d51ae5e 100644
--- a/server/controllers/api/users/index.ts
+++ b/server/controllers/api/users/index.ts
@@ -134,7 +134,8 @@ async function createUser (req: express.Request, res: express.Response) {
134 nsfwPolicy: CONFIG.INSTANCE.DEFAULT_NSFW_POLICY, 134 nsfwPolicy: CONFIG.INSTANCE.DEFAULT_NSFW_POLICY,
135 autoPlayVideo: true, 135 autoPlayVideo: true,
136 role: body.role, 136 role: body.role,
137 videoQuota: body.videoQuota 137 videoQuota: body.videoQuota,
138 videoQuotaDaily: body.videoQuotaDaily
138 }) 139 })
139 140
140 const { user, account } = await createUserAccountAndChannel(userToCreate) 141 const { user, account } = await createUserAccountAndChannel(userToCreate)
@@ -163,7 +164,8 @@ async function registerUser (req: express.Request, res: express.Response) {
163 nsfwPolicy: CONFIG.INSTANCE.DEFAULT_NSFW_POLICY, 164 nsfwPolicy: CONFIG.INSTANCE.DEFAULT_NSFW_POLICY,
164 autoPlayVideo: true, 165 autoPlayVideo: true,
165 role: UserRole.USER, 166 role: UserRole.USER,
166 videoQuota: CONFIG.USER.VIDEO_QUOTA 167 videoQuota: CONFIG.USER.VIDEO_QUOTA,
168 videoQuotaDaily: CONFIG.USER.VIDEO_QUOTA_DAILY
167 }) 169 })
168 170
169 const { user } = await createUserAccountAndChannel(userToCreate) 171 const { user } = await createUserAccountAndChannel(userToCreate)
@@ -219,6 +221,7 @@ async function updateUser (req: express.Request, res: express.Response, next: ex
219 221
220 if (body.email !== undefined) userToUpdate.email = body.email 222 if (body.email !== undefined) userToUpdate.email = body.email
221 if (body.videoQuota !== undefined) userToUpdate.videoQuota = body.videoQuota 223 if (body.videoQuota !== undefined) userToUpdate.videoQuota = body.videoQuota
224 if (body.videoQuotaDaily !== undefined) userToUpdate.videoQuotaDaily = body.videoQuotaDaily
222 if (body.role !== undefined) userToUpdate.role = body.role 225 if (body.role !== undefined) userToUpdate.role = body.role
223 226
224 const user = await userToUpdate.save() 227 const user = await userToUpdate.save()