X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=server%2Fcontrollers%2Fapi%2Fusers%2Findex.ts;h=99f51a64831200228d601ebe082098ffda1418e8;hb=1f20622f2b087eaf8738d60fae00a44b9c558ca3;hp=48a6c63b832cc16e9d4112a3285a32ed7b799b61;hpb=60919831276e9c9e9900258bec82b6c31e9e5dd3;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/controllers/api/users/index.ts b/server/controllers/api/users/index.ts index 48a6c63b8..99f51a648 100644 --- a/server/controllers/api/users/index.ts +++ b/server/controllers/api/users/index.ts @@ -184,7 +184,7 @@ async function createUser (req: express.Request, res: express.Response) { adminFlags: body.adminFlags || UserAdminFlag.NONE }) - const { user, account } = await createUserAccountAndChannelAndPlaylist(userToCreate) + const { user, account } = await createUserAccountAndChannelAndPlaylist({ userToCreate: userToCreate }) auditLogger.create(getAuditIdFromRes(res), new UserAuditView(user.toFormattedJSON())) logger.info('User %s with its channel and account created.', body.username) @@ -214,7 +214,11 @@ async function registerUser (req: express.Request, res: express.Response) { emailVerified: CONFIG.SIGNUP.REQUIRES_EMAIL_VERIFICATION ? false : null }) - const { user } = await createUserAccountAndChannelAndPlaylist(userToCreate, body.channel) + const { user } = await createUserAccountAndChannelAndPlaylist({ + userToCreate: userToCreate, + userDisplayName: body.displayName || undefined, + channelNames: body.channel + }) auditLogger.create(body.username, new UserAuditView(user.toFormattedJSON())) logger.info('User %s with its channel and account registered.', body.username)