aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--server/controllers/api/users/index.ts6
-rw-r--r--shared/models/users/user-create.model.ts1
2 files changed, 6 insertions, 1 deletions
diff --git a/server/controllers/api/users/index.ts b/server/controllers/api/users/index.ts
index d339c2a1c..869f31d84 100644
--- a/server/controllers/api/users/index.ts
+++ b/server/controllers/api/users/index.ts
@@ -176,6 +176,7 @@ export {
176 176
177async function createUser (req: express.Request, res: express.Response) { 177async function createUser (req: express.Request, res: express.Response) {
178 const body: UserCreate = req.body 178 const body: UserCreate = req.body
179
179 const userToCreate = new UserModel({ 180 const userToCreate = new UserModel({
180 username: body.username, 181 username: body.username,
181 password: body.password, 182 password: body.password,
@@ -194,7 +195,10 @@ async function createUser (req: express.Request, res: express.Response) {
194 userToCreate.password = await generateRandomString(20) 195 userToCreate.password = await generateRandomString(20)
195 } 196 }
196 197
197 const { user, account, videoChannel } = await createUserAccountAndChannelAndPlaylist({ userToCreate: userToCreate }) 198 const { user, account, videoChannel } = await createUserAccountAndChannelAndPlaylist({
199 userToCreate,
200 channelNames: { name: body.channelName, displayName: body.channelName }
201 })
198 202
199 auditLogger.create(getAuditIdFromRes(res), new UserAuditView(user.toFormattedJSON())) 203 auditLogger.create(getAuditIdFromRes(res), new UserAuditView(user.toFormattedJSON()))
200 logger.info('User %s with its channel and account created.', body.username) 204 logger.info('User %s with its channel and account created.', body.username)
diff --git a/shared/models/users/user-create.model.ts b/shared/models/users/user-create.model.ts
index 6677b42aa..601c531cd 100644
--- a/shared/models/users/user-create.model.ts
+++ b/shared/models/users/user-create.model.ts
@@ -9,4 +9,5 @@ export interface UserCreate {
9 videoQuotaDaily: number 9 videoQuotaDaily: number
10 role: UserRole 10 role: UserRole
11 adminFlags?: UserAdminFlag 11 adminFlags?: UserAdminFlag
12 channelName: string
12} 13}