From: kimsible Date: Wed, 29 Jul 2020 16:35:17 +0000 (+0200) Subject: Make channelName optionnal only for the API X-Git-Tag: v2.4.0-rc.1~122 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=69db1470432a6db8ef6929ef3175af75f7aaa963;hp=4e68fc8605bff02f4c79deafc24cb39779802d0d;p=github%2FChocobozzz%2FPeerTube.git Make channelName optionnal only for the API --- diff --git a/server/controllers/api/users/index.ts b/server/controllers/api/users/index.ts index 869f31d84..5ae0dc7a7 100644 --- a/server/controllers/api/users/index.ts +++ b/server/controllers/api/users/index.ts @@ -197,7 +197,7 @@ async function createUser (req: express.Request, res: express.Response) { const { user, account, videoChannel } = await createUserAccountAndChannelAndPlaylist({ userToCreate, - channelNames: { name: body.channelName, displayName: body.channelName } + channelNames: body.channelName && { name: body.channelName, displayName: body.channelName } }) auditLogger.create(getAuditIdFromRes(res), new UserAuditView(user.toFormattedJSON())) diff --git a/shared/models/users/user-create.model.ts b/shared/models/users/user-create.model.ts index 601c531cd..ddc71dd59 100644 --- a/shared/models/users/user-create.model.ts +++ b/shared/models/users/user-create.model.ts @@ -9,5 +9,5 @@ export interface UserCreate { videoQuotaDaily: number role: UserRole adminFlags?: UserAdminFlag - channelName: string + channelName?: string }