-import { omit } from 'lodash'
-import { pick } from '@shared/core-utils'
+import { omit, pick } from '@shared/core-utils'
import {
HttpStatusCode,
MyUser,
token,
userId: user.id,
userChannelId: me.videoChannels[0].id,
- userChannelName: me.videoChannels[0].name
+ userChannelName: me.videoChannels[0].name,
+ password
}
}
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({
fields: {
username,
password,
- email: username + '@example.com',
+ email,
displayName,
channel
},
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,