X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=shared%2Fserver-commands%2Fusers%2Fusers-command.ts;h=811b9685b42c4c3293a5dfcf5b6500cd3eb3dc8f;hb=71e3e879c0616882ee82a0e44f8c2e5ee9698a3e;hp=b5ae9008e4ce63b631aa797e0e0a99e2d9b837f4;hpb=3318147300b4f998adf728eb0a5a14a4c1829c51;p=github%2FChocobozzz%2FPeerTube.git diff --git a/shared/server-commands/users/users-command.ts b/shared/server-commands/users/users-command.ts index b5ae9008e..811b9685b 100644 --- a/shared/server-commands/users/users-command.ts +++ b/shared/server-commands/users/users-command.ts @@ -1,5 +1,4 @@ -import { omit } from 'lodash' -import { pick } from '@shared/core-utils' +import { omit, pick } from '@shared/core-utils' import { HttpStatusCode, MyUser, @@ -203,7 +202,8 @@ export class UsersCommand extends AbstractCommand { token, userId: user.id, userChannelId: me.videoChannels[0].id, - userChannelName: me.videoChannels[0].name + userChannelName: me.videoChannels[0].name, + password } } @@ -218,12 +218,13 @@ export class UsersCommand extends AbstractCommand { username: string password?: string displayName?: string + email?: string channel?: { name: string displayName: string } }) { - const { username, password = 'password', displayName, channel } = options + const { username, password = 'password', displayName, channel, email = username + '@example.com' } = options const path = '/api/v1/users/register' return this.postBodyRequest({ @@ -233,7 +234,7 @@ export class UsersCommand extends AbstractCommand { fields: { username, password, - email: username + '@example.com', + email, displayName, channel }, @@ -298,7 +299,7 @@ export class UsersCommand extends AbstractCommand { updateMe (options: OverrideCommandOptions & UserUpdateMe) { const path = '/api/v1/users/me' - const toSend: UserUpdateMe = omit(options, 'url', 'accessToken') + const toSend: UserUpdateMe = omit(options, [ 'expectedStatus', 'token' ]) return this.putBodyRequest({ ...options,