]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Make channelName optionnal only for the API
authorkimsible <kimsible@users.noreply.github.com>
Wed, 29 Jul 2020 16:35:17 +0000 (18:35 +0200)
committerChocobozzz <chocobozzz@cpy.re>
Tue, 11 Aug 2020 06:46:35 +0000 (08:46 +0200)
server/controllers/api/users/index.ts
shared/models/users/user-create.model.ts

index 869f31d848ce739175d5288d3a02d1aaa52fabd0..5ae0dc7a736a530d8faf92339c8ed5c63d2426db 100644 (file)
@@ -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()))
index 601c531cd1cfe2d99c9637c2902a1d203b6ae781..ddc71dd598ec9ba4e9c176c521ac7b92fc23ea36 100644 (file)
@@ -9,5 +9,5 @@ export interface UserCreate {
   videoQuotaDaily: number
   role: UserRole
   adminFlags?: UserAdminFlag
-  channelName: string
+  channelName?: string
 }