X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fcontrollers%2Fapi%2Fusers%2Findex.ts;h=25d51ae5e744a5f3ec9ac3c62c899048d559e4c9;hb=bee0abffff73804d816b90c7fd599e0a51c09d61;hp=608d439ac890508eb214036bf19806b77844cff5;hpb=c907c2fa3fd7c0a741117a0204d0ebca675124bd;p=github%2FChocobozzz%2FPeerTube.git 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) { nsfwPolicy: CONFIG.INSTANCE.DEFAULT_NSFW_POLICY, autoPlayVideo: true, role: body.role, - videoQuota: body.videoQuota + videoQuota: body.videoQuota, + videoQuotaDaily: body.videoQuotaDaily }) const { user, account } = await createUserAccountAndChannel(userToCreate) @@ -163,7 +164,8 @@ async function registerUser (req: express.Request, res: express.Response) { nsfwPolicy: CONFIG.INSTANCE.DEFAULT_NSFW_POLICY, autoPlayVideo: true, role: UserRole.USER, - videoQuota: CONFIG.USER.VIDEO_QUOTA + videoQuota: CONFIG.USER.VIDEO_QUOTA, + videoQuotaDaily: CONFIG.USER.VIDEO_QUOTA_DAILY }) const { user } = await createUserAccountAndChannel(userToCreate) @@ -219,6 +221,7 @@ async function updateUser (req: express.Request, res: express.Response, next: ex if (body.email !== undefined) userToUpdate.email = body.email if (body.videoQuota !== undefined) userToUpdate.videoQuota = body.videoQuota + if (body.videoQuotaDaily !== undefined) userToUpdate.videoQuotaDaily = body.videoQuotaDaily if (body.role !== undefined) userToUpdate.role = body.role const user = await userToUpdate.save()