]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/server-commands/users/users-command.ts
Merge branch 'release/4.3.0' into develop
[github/Chocobozzz/PeerTube.git] / shared / server-commands / users / users-command.ts
index b5ae9008e4ce63b631aa797e0e0a99e2d9b837f4..e7d0210595bd937ce4de9b530006ac6b913887fc 100644 (file)
@@ -1,5 +1,4 @@
-import { omit } from 'lodash'
-import { pick } from '@shared/core-utils'
+import { omit, pick } from '@shared/core-utils'
 import {
   HttpStatusCode,
   MyUser,
@@ -218,12 +217,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 +233,7 @@ export class UsersCommand extends AbstractCommand {
       fields: {
         username,
         password,
-        email: username + '@example.com',
+        email,
         displayName,
         channel
       },
@@ -298,7 +298,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,